pub trait NodeQueries<'a>: IntoIterGlobalNodeswhere
Self::Iter: 'a,{
// Provided methods
fn siblings(self, ctx: &RootContext) -> NodeCluster { ... }
fn flows_to(
self,
sink: impl IntoIterGlobalNodes,
ctx: &RootContext,
edge_type: EdgeSelection,
) -> bool { ... }
fn find_flow(
self,
sink: impl IntoIterGlobalNodes,
ctx: &RootContext,
edge_type: EdgeSelection,
) -> Option<GlobalNode> { ... }
fn consuming_call_sites(
self,
ctx: &'a RootContext,
) -> Box<dyn Iterator<Item = CallString> + 'a> { ... }
fn has_ctrl_influence(
self,
target: impl IntoIterGlobalNodes,
ctx: &RootContext,
) -> bool { ... }
fn influencers(
self,
ctx: &RootContext,
edge_type: EdgeSelection,
) -> Vec<GlobalNode> { ... }
fn influencees(
self,
ctx: &RootContext,
edge_type: EdgeSelection,
) -> Vec<GlobalNode> { ... }
}
Expand description
Context queries conveniently accessible on nodes
Provided Methods§
Sourcefn siblings(self, ctx: &RootContext) -> NodeCluster
fn siblings(self, ctx: &RootContext) -> NodeCluster
Get other nodes at the same instruction
Sourcefn flows_to(
self,
sink: impl IntoIterGlobalNodes,
ctx: &RootContext,
edge_type: EdgeSelection,
) -> bool
fn flows_to( self, sink: impl IntoIterGlobalNodes, ctx: &RootContext, edge_type: EdgeSelection, ) -> bool
Returns whether a node flows to a node through the configured edge type.
Nodes do not flow to themselves. CallArgument nodes do flow to their respective CallSites.
If you use flows_to with EdgeSelection::Control
, you might want to
consider using RootContext::has_ctrl_influence
, which additionally
considers intermediate nodes which the src node has data flow to and has
ctrl influence on the sink.
Sourcefn find_flow(
self,
sink: impl IntoIterGlobalNodes,
ctx: &RootContext,
edge_type: EdgeSelection,
) -> Option<GlobalNode>
fn find_flow( self, sink: impl IntoIterGlobalNodes, ctx: &RootContext, edge_type: EdgeSelection, ) -> Option<GlobalNode>
Returns the sink node that is reached
Nodes do not flow to themselves. CallArgument nodes do flow to their respective CallSites.
If you use flows_to with EdgeSelection::Control
, you might want to
consider using RootContext::has_ctrl_influence
, which additionally
considers intermediate nodes which the src node has data flow to and has
ctrl influence on the sink.
Sourcefn consuming_call_sites(
self,
ctx: &'a RootContext,
) -> Box<dyn Iterator<Item = CallString> + 'a>
fn consuming_call_sites( self, ctx: &'a RootContext, ) -> Box<dyn Iterator<Item = CallString> + 'a>
Call sites that consume this node directly. E.g. the outgoing edges.
Sourcefn has_ctrl_influence(
self,
target: impl IntoIterGlobalNodes,
ctx: &RootContext,
) -> bool
fn has_ctrl_influence( self, target: impl IntoIterGlobalNodes, ctx: &RootContext, ) -> bool
Returns whether there is direct control flow influence from influencer to sink, or there is some node which is data-flow influenced by influencer
and has direct control flow influence on target
. Or as expressed in code:
some n where self.flows_to(influencer, n, EdgeSelection::Data) && self.flows_to(n, target, EdgeSelection::Control)
.
Sourcefn influencers(
self,
ctx: &RootContext,
edge_type: EdgeSelection,
) -> Vec<GlobalNode>
fn influencers( self, ctx: &RootContext, edge_type: EdgeSelection, ) -> Vec<GlobalNode>
Returns iterator over all Nodes that influence the given sink Node.
Does not return the input node. A CallSite sink will return all of the associated CallArgument nodes.
Sourcefn influencees(
self,
ctx: &RootContext,
edge_type: EdgeSelection,
) -> Vec<GlobalNode>
fn influencees( self, ctx: &RootContext, edge_type: EdgeSelection, ) -> Vec<GlobalNode>
Returns iterator over all Nodes that are influenced by the given src Node.
Does not return the input node. A CallArgument src will return the associated CallSite.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.