pub trait NodeExt: Sealed {
    // Required methods
    fn has_type(self, t: TypeId, ctx: &Context) -> bool;
    fn associated_call_site(self, ctx: &Context) -> CallString;
    fn types(self, ctx: &Context) -> &[TypeId];
    fn describe(self, ctx: &Context) -> DisplayNode<'_>;
    fn info(self, ctx: &Context) -> &NodeInfo;
    fn instruction(self, ctx: &Context) -> &InstructionInfo;
    fn successors(
        self,
        ctx: &Context
    ) -> Box<dyn Iterator<Item = GlobalNode> + '_>;
    fn predecessors(
        self,
        ctx: &Context
    ) -> Box<dyn Iterator<Item = GlobalNode> + '_>;
    fn get_location(self, ctx: &Context) -> &Span;
    fn has_marker<C: HasDiagnosticsBase>(self, ctx: C, marker: Marker) -> bool;
    fn shortest_path(
        self,
        to: GlobalNode,
        ctx: &Context,
        edge_selection: EdgeSelection
    ) -> Option<Box<[GlobalNode]>>;
}
Expand description

Extension trait with queries for single nodes

Required Methods§

source

fn has_type(self, t: TypeId, ctx: &Context) -> bool

Returns true if this node has the provided type

source

fn associated_call_site(self, ctx: &Context) -> CallString

Find the call string for the statement or function that produced this node.

source

fn types(self, ctx: &Context) -> &[TypeId]

Get the type(s) of a Node.

source

fn describe(self, ctx: &Context) -> DisplayNode<'_>

Returns a DisplayNode for the given Node

source

fn info(self, ctx: &Context) -> &NodeInfo

Retrieve metadata about a node.

source

fn instruction(self, ctx: &Context) -> &InstructionInfo

Retrieve metadata about the instruction executed by a specific node.

source

fn successors(self, ctx: &Context) -> Box<dyn Iterator<Item = GlobalNode> + '_>

Return the immediate successors of this node

source

fn predecessors( self, ctx: &Context ) -> Box<dyn Iterator<Item = GlobalNode> + '_>

Return the immediate predecessors of this node

source

fn get_location(self, ctx: &Context) -> &Span

Get the span of a node

source

fn has_marker<C: HasDiagnosticsBase>(self, ctx: C, marker: Marker) -> bool

Returns whether this Node has the marker applied to it directly or via its type.

source

fn shortest_path( self, to: GlobalNode, ctx: &Context, edge_selection: EdgeSelection ) -> Option<Box<[GlobalNode]>>

The shortest path between this and a target node

Implementations on Foreign Types§

source§

impl<T: NodeExt + Copy> NodeExt for &T

source§

fn has_type(self, t: TypeId, ctx: &Context) -> bool

source§

fn info(self, ctx: &Context) -> &NodeInfo

source§

fn types(self, ctx: &Context) -> &[TypeId]

source§

fn describe(self, ctx: &Context) -> DisplayNode<'_>

source§

fn has_marker<C: HasDiagnosticsBase>(self, ctx: C, marker: Marker) -> bool

source§

fn successors(self, ctx: &Context) -> Box<dyn Iterator<Item = GlobalNode> + '_>

source§

fn instruction(self, ctx: &Context) -> &InstructionInfo

source§

fn get_location(self, ctx: &Context) -> &Span

source§

fn predecessors( self, ctx: &Context ) -> Box<dyn Iterator<Item = GlobalNode> + '_>

source§

fn shortest_path( self, to: GlobalNode, ctx: &Context, edge_selection: EdgeSelection ) -> Option<Box<[GlobalNode]>>

source§

fn associated_call_site(self, ctx: &Context) -> CallString

Implementors§