Trait paralegal_policy::NodeExt
source · 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§
sourcefn has_type(self, t: TypeId, ctx: &Context) -> bool
fn has_type(self, t: TypeId, ctx: &Context) -> bool
Returns true if this node has the provided type
sourcefn associated_call_site(self, ctx: &Context) -> CallString
fn associated_call_site(self, ctx: &Context) -> CallString
Find the call string for the statement or function that produced this node.
sourcefn describe(self, ctx: &Context) -> DisplayNode<'_>
fn describe(self, ctx: &Context) -> DisplayNode<'_>
Returns a DisplayNode for the given Node
sourcefn instruction(self, ctx: &Context) -> &InstructionInfo
fn instruction(self, ctx: &Context) -> &InstructionInfo
Retrieve metadata about the instruction executed by a specific node.
sourcefn successors(self, ctx: &Context) -> Box<dyn Iterator<Item = GlobalNode> + '_>
fn successors(self, ctx: &Context) -> Box<dyn Iterator<Item = GlobalNode> + '_>
Return the immediate successors of this node
sourcefn predecessors(
self,
ctx: &Context
) -> Box<dyn Iterator<Item = GlobalNode> + '_>
fn predecessors( self, ctx: &Context ) -> Box<dyn Iterator<Item = GlobalNode> + '_>
Return the immediate predecessors of this node
sourcefn get_location(self, ctx: &Context) -> &Span
fn get_location(self, ctx: &Context) -> &Span
Get the span of a node
sourcefn has_marker<C: HasDiagnosticsBase>(self, ctx: C, marker: Marker) -> bool
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.
sourcefn shortest_path(
self,
to: GlobalNode,
ctx: &Context,
edge_selection: EdgeSelection
) -> Option<Box<[GlobalNode]>>
fn shortest_path( self, to: GlobalNode, ctx: &Context, edge_selection: EdgeSelection ) -> Option<Box<[GlobalNode]>>
The shortest path between this and a target node