FlowGraphNode

Struct FlowGraphNode 

Source
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

Source

pub fn new(graph: &FlowGraph) -> Ref<Self>

Source

pub fn basic_block<C: BlockContext>( &self, context: C, ) -> Option<Ref<BasicBlock<C>>>

Source

pub fn set_basic_block<C: BlockContext>(&self, block: Option<&BasicBlock<C>>)

Source

pub fn lines(&self) -> Array<DisassemblyTextLine>

Source

pub fn set_lines(&self, lines: impl IntoIterator<Item = DisassemblyTextLine>)

Source

pub fn position(&self) -> (i32, i32)

Returns the graph position of the node in X, Y form.

Source

pub fn size(&self) -> (i32, i32)

Returns the size of the node in width, height form.

Source

pub fn set_position(&self, x: i32, y: i32)

Sets the graph position of the node.

Source

pub fn highlight_color(&self) -> HighlightColor

Source

pub fn set_highlight_color(&self, highlight: HighlightColor)

Source

pub fn incoming_edges(&self) -> Array<FlowGraphEdge>

Edges flowing into this node.

Source

pub fn outgoing_edges(&self) -> Array<FlowGraphEdge>

Edges flowing out of this node.

Source

pub fn add_outgoing_edge( &self, type_: BranchType, target: &FlowGraphNode, edge_style: EdgeStyle, )

Connects two flow graph nodes with an edge.

Source

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.

Source

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

Source§

impl Debug for FlowGraphNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for FlowGraphNode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FlowGraphNode

Source§

fn eq(&self, other: &FlowGraphNode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToOwned for FlowGraphNode

Source§

type Owned = Ref<FlowGraphNode>

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl Eq for FlowGraphNode

Source§

impl StructuralPartialEq for FlowGraphNode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more