pub struct GlobalNode {
pub(crate) node: NodeIndex,
pub(crate) controller_id: DefId,
}
Expand description
A globally identified node in an SPDG
Fields§
§node: NodeIndex
§controller_id: DefId
Implementations§
Source§impl GlobalNode
impl GlobalNode
Sourcepub fn unsafe_new(ctrl_id: DefId, index: usize) -> GlobalNode
pub fn unsafe_new(ctrl_id: DefId, index: usize) -> GlobalNode
Create a new node with no guarantee that it exists in the SPDG of the controller.
Sourcepub fn from_local_node(ctrl_id: DefId, node: NodeIndex) -> GlobalNode
pub fn from_local_node(ctrl_id: DefId, node: NodeIndex) -> GlobalNode
Create a new globally identified node by pairing a node local to a particular SPDG with it’s controller id.
Meant for internal use only.
Sourcepub fn local_node(self) -> NodeIndex
pub fn local_node(self) -> NodeIndex
The local node in the SPDG
Sourcepub fn controller_id(self) -> DefId
pub fn controller_id(self) -> DefId
The identifier for the SPDG this node is contained in
Trait Implementations§
Source§impl Clone for GlobalNode
impl Clone for GlobalNode
Source§fn clone(&self) -> GlobalNode
fn clone(&self) -> GlobalNode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GlobalNode
impl Debug for GlobalNode
Source§impl Hash for GlobalNode
impl Hash for GlobalNode
Source§impl IntoIterGlobalNodes for GlobalNode
impl IntoIterGlobalNodes for GlobalNode
Source§fn iter_nodes(self) -> <GlobalNode as IntoIterGlobalNodes>::Iter
fn iter_nodes(self) -> <GlobalNode as IntoIterGlobalNodes>::Iter
iterate over the local nodes
Source§fn controller_id(self) -> DefId
fn controller_id(self) -> DefId
The controller id all of these nodes are located in.
Source§fn iter_global_nodes(self) -> GlobalNodeIter<Self>
fn iter_global_nodes(self) -> GlobalNodeIter<Self>
Iterate all nodes as globally identified one’s. Read more
Source§fn extended(self, other: impl IntoIterGlobalNodes) -> Option<NodeCluster>
fn extended(self, other: impl IntoIterGlobalNodes) -> Option<NodeCluster>
A convenience method for gathering multiple node(cluster)s together. Read more
Source§fn to_local_cluster(self) -> NodeCluster
fn to_local_cluster(self) -> NodeCluster
Collect the iterator into a cluster
Source§impl NodeExt for GlobalNode
impl NodeExt for GlobalNode
Source§fn 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.
Source§fn has_type(self, t: TypeId, ctx: &RootContext) -> bool
fn has_type(self, t: TypeId, ctx: &RootContext) -> bool
Returns true if this node has the provided type
Source§fn associated_call_site(self, ctx: &RootContext) -> CallString
fn associated_call_site(self, ctx: &RootContext) -> CallString
Find the call string for the statement or function that produced this node.
Source§fn types(self, ctx: &RootContext) -> &[TypeId]
fn types(self, ctx: &RootContext) -> &[TypeId]
Get the type(s) of a Node.
Source§fn describe(self, ctx: &RootContext) -> DisplayNode<'_>
fn describe(self, ctx: &RootContext) -> DisplayNode<'_>
Returns a DisplayNode for the given Node
Source§fn info(self, ctx: &RootContext) -> &NodeInfo
fn info(self, ctx: &RootContext) -> &NodeInfo
Retrieve metadata about a node.
Source§fn instruction(self, ctx: &RootContext) -> &InstructionInfo
fn instruction(self, ctx: &RootContext) -> &InstructionInfo
Retrieve metadata about the instruction executed by a specific node.
Source§fn successors(
self,
ctx: &RootContext,
) -> Box<dyn Iterator<Item = GlobalNode> + '_>
fn successors( self, ctx: &RootContext, ) -> Box<dyn Iterator<Item = GlobalNode> + '_>
Return the immediate successors of this node
Source§fn predecessors(
self,
ctx: &RootContext,
) -> Box<dyn Iterator<Item = GlobalNode> + '_>
fn predecessors( self, ctx: &RootContext, ) -> Box<dyn Iterator<Item = GlobalNode> + '_>
Return the immediate predecessors of this node
Source§fn get_location(self, ctx: &RootContext) -> &Span
fn get_location(self, ctx: &RootContext) -> &Span
Get the span of a node
Source§fn shortest_path(
self,
to: Self,
ctx: &RootContext,
edge_selection: EdgeSelection,
) -> Option<Box<[Self]>>
fn shortest_path( self, to: Self, ctx: &RootContext, edge_selection: EdgeSelection, ) -> Option<Box<[Self]>>
👎Deprecated: This function is known to be buggy at the moment. Only use for debugging, don’t rely on it for policy correctness.
The shortest path between this and a target node
Source§impl PartialEq for GlobalNode
impl PartialEq for GlobalNode
impl Copy for GlobalNode
impl Eq for GlobalNode
impl Sealed for GlobalNode
impl StructuralPartialEq for GlobalNode
Auto Trait Implementations§
impl Freeze for GlobalNode
impl RefUnwindSafe for GlobalNode
impl Send for GlobalNode
impl Sync for GlobalNode
impl Unpin for GlobalNode
impl UnwindSafe for GlobalNode
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.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>
Converts
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>
Converts
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 moreSource§impl<'a, T> NodeQueries<'a> for Twhere
T: IntoIterGlobalNodes + 'a,
impl<'a, T> NodeQueries<'a> for Twhere
T: IntoIterGlobalNodes + 'a,
Source§fn siblings(self, ctx: &RootContext) -> NodeCluster
fn siblings(self, ctx: &RootContext) -> NodeCluster
Get other nodes at the same instruction
Source§fn 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. Read more
Source§fn 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 Read more
Source§fn 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.
Source§fn 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: Read moreSource§fn 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. Read more
Source§fn 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. Read more
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.