pub struct FlowGraphNode { /* private fields */ }Expand description
The node of a flow graph containing lines of text tokens, and edges flowing into and out of it.
A node can also be backed by a BasicBlock, which makes the node function as a basic block node.
A node is positioned absolutely within the flow graph and is typically positioned by a FlowGraphLayout.
Implementations§
Source§impl FlowGraphNode
impl FlowGraphNode
pub fn new(graph: &FlowGraph) -> Ref<Self>
pub fn basic_block<C: BlockContext>( &self, context: C, ) -> Option<Ref<BasicBlock<C>>>
pub fn set_basic_block<C: BlockContext>(&self, block: Option<&BasicBlock<C>>)
pub fn lines(&self) -> Array<DisassemblyTextLine>
pub fn set_lines(&self, lines: impl IntoIterator<Item = DisassemblyTextLine>)
Sourcepub fn set_position(&self, x: i32, y: i32)
pub fn set_position(&self, x: i32, y: i32)
Sets the graph position of the node.
pub fn highlight_color(&self) -> HighlightColor
pub fn set_highlight_color(&self, highlight: HighlightColor)
Sourcepub fn incoming_edges(&self) -> Array<FlowGraphEdge>
pub fn incoming_edges(&self) -> Array<FlowGraphEdge>
Edges flowing into this node.
Sourcepub fn outgoing_edges(&self) -> Array<FlowGraphEdge>
pub fn outgoing_edges(&self) -> Array<FlowGraphEdge>
Edges flowing out of this node.
Sourcepub fn add_outgoing_edge(
&self,
type_: BranchType,
target: &FlowGraphNode,
edge_style: EdgeStyle,
)
pub fn add_outgoing_edge( &self, type_: BranchType, target: &FlowGraphNode, edge_style: EdgeStyle, )
Connects two flow graph nodes with an edge.
Sourcepub fn set_outgoing_edge_points(&self, edge_idx: usize, points: &[Point])
pub fn set_outgoing_edge_points(&self, edge_idx: usize, points: &[Point])
Sets the outgoing edge points for edge_idx.
This is typically called when laying out a FlowGraph using FlowGraphLayout, without
calling this for all given node edges in a graph; the nodes will be rendered without any
edges between them, as edge routing is not automatic.
Sourcepub fn set_visibility_region(&self, x: i32, y: i32, w: i32, h: i32)
pub fn set_visibility_region(&self, x: i32, y: i32, w: i32, h: i32)
Sets the graph-coordinate bounding rectangle used for visibility/layout calculations.
This is what is used to determine the nodes returned by FlowGraph::visible_nodes.
Custom FlowGraphLayout implementations should call this after positioning the node and
routing its outgoing edges, before setting the final graph size. The region should cover the
node itself and any routed edge points owned by this node, so the renderer can determine what
part of the graph needs to be visible/redrawn for the node.
Trait Implementations§
Source§impl CoreArrayProvider for FlowGraphNode
impl CoreArrayProvider for FlowGraphNode
Source§impl Debug for FlowGraphNode
impl Debug for FlowGraphNode
Source§impl Hash for FlowGraphNode
impl Hash for FlowGraphNode
Source§impl PartialEq for FlowGraphNode
impl PartialEq for FlowGraphNode
Source§impl ToOwned for FlowGraphNode
impl ToOwned for FlowGraphNode
Source§type Owned = Ref<FlowGraphNode>
type Owned = Ref<FlowGraphNode>
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
impl Eq for FlowGraphNode
impl StructuralPartialEq for FlowGraphNode
Auto Trait Implementations§
impl Freeze for FlowGraphNode
impl RefUnwindSafe for FlowGraphNode
impl !Send for FlowGraphNode
impl !Sync for FlowGraphNode
impl Unpin for FlowGraphNode
impl UnsafeUnpin for FlowGraphNode
impl UnwindSafe for FlowGraphNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more