Struct paralegal_spdg::CallString
source · pub struct CallString(Intern<Box<[GlobalLocation], Global>>);
Expand description
A location within the global call-graph.
The first location is the root of the call-graph. The last location is the currently-called function.
Invariant: a call string should never be empty, i.e.,
there should always be at least one GlobalLocation
in a call-string.
Note: This type is copyable due to interning.
Tuple Fields§
§0: Intern<Box<[GlobalLocation], Global>>
Implementations§
source§impl CallString
impl CallString
sourcepub fn pop(self) -> (GlobalLocation, Option<CallString>)
pub fn pop(self) -> (GlobalLocation, Option<CallString>)
Split the leaf (the current instruction) from the caller for the
function (if any) and return both. Same as (self.leaf(), self.caller())
.
sourcepub fn single(loc: GlobalLocation) -> CallString
pub fn single(loc: GlobalLocation) -> CallString
Create an initial call string for the single location loc
.
sourcepub fn leaf(self) -> GlobalLocation
pub fn leaf(self) -> GlobalLocation
Returns the leaf of the call string (the currently-called function).
sourcepub fn caller(self) -> Option<CallString>
pub fn caller(self) -> Option<CallString>
Returns the call string minus the leaf. Returns None
if this location
is at the root.
sourcepub fn iter(&self) -> impl DoubleEndedIterator
pub fn iter(&self) -> impl DoubleEndedIterator
Returns an iterator over the locations in the call string, starting at the leaf and going to the root.
sourcepub fn push(self, loc: GlobalLocation) -> CallString
pub fn push(self, loc: GlobalLocation) -> CallString
Adds a new call site to the end of the call string.
pub fn push_front(self, loc: GlobalLocation) -> CallString
pub fn is_at_root(self) -> bool
pub fn root(self) -> GlobalLocation
pub fn stable_id(self) -> usize
sourcepub fn iter_from_root(&self) -> impl DoubleEndedIterator
pub fn iter_from_root(&self) -> impl DoubleEndedIterator
Returns an iterator over the locations in the call string, starting at the root and going to the leaf.
pub fn len(self) -> usize
pub fn is_empty(self) -> bool
Trait Implementations§
source§impl Clone for CallString
impl Clone for CallString
source§fn clone(&self) -> CallString
fn clone(&self) -> CallString
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CallString
impl Debug for CallString
source§impl<'de> Deserialize<'de> for CallString
impl<'de> Deserialize<'de> for CallString
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<CallString, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<CallString, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl Display for CallString
impl Display for CallString
source§impl<'a, 'd> GraphWalk<'a, CallString, GlobalEdge> for DotPrintableProgramDescription<'d>
impl<'a, 'd> GraphWalk<'a, CallString, GlobalEdge> for DotPrintableProgramDescription<'d>
source§fn nodes(&'a self) -> Nodes<'a, CallString>
fn nodes(&'a self) -> Nodes<'a, CallString>
source§fn edges(&'a self) -> Edges<'a, GlobalEdge>
fn edges(&'a self) -> Edges<'a, GlobalEdge>
source§fn source(&'a self, edge: &GlobalEdge) -> CallString
fn source(&'a self, edge: &GlobalEdge) -> CallString
edge
.source§fn target(&'a self, edge: &GlobalEdge) -> CallString
fn target(&'a self, edge: &GlobalEdge) -> CallString
edge
.source§impl Hash for CallString
impl Hash for CallString
source§impl<'a, 'd> Labeller<'a, CallString, GlobalEdge> for DotPrintableProgramDescription<'d>
impl<'a, 'd> Labeller<'a, CallString, GlobalEdge> for DotPrintableProgramDescription<'d>
source§fn node_id(&'a self, n: &CallString) -> Id<'a>
fn node_id(&'a self, n: &CallString) -> Id<'a>
n
to a unique identifier with respect to self
. The
implementer is responsible for ensuring that the returned name
is a valid DOT identifier.source§fn node_shape(&'a self, _node: &CallString) -> Option<LabelText<'a>>
fn node_shape(&'a self, _node: &CallString) -> Option<LabelText<'a>>
source§fn node_label(&'a self, n: &CallString) -> LabelText<'a>
fn node_label(&'a self, n: &CallString) -> LabelText<'a>
n
to a label that will be used in the rendered output.
The label need not be unique, and may be the empty string; the
default is just the output from node_id
.source§fn edge_color(&'a self, e: &GlobalEdge) -> Option<LabelText<'a>>
fn edge_color(&'a self, e: &GlobalEdge) -> Option<LabelText<'a>>
source§fn source_port_position(
&'a self,
edge: &GlobalEdge
) -> (Option<Id<'a>>, Option<CompassPoint>)
fn source_port_position( &'a self, edge: &GlobalEdge ) -> (Option<Id<'a>>, Option<CompassPoint>)
source§fn target_port_position(
&'a self,
edge: &GlobalEdge
) -> (Option<Id<'a>>, Option<CompassPoint>)
fn target_port_position( &'a self, edge: &GlobalEdge ) -> (Option<Id<'a>>, Option<CompassPoint>)
source_port_position
but for the target end of the edge.source§fn edge_label(&'a self, e: &E) -> LabelText<'a>
fn edge_label(&'a self, e: &E) -> LabelText<'a>
e
to a label that will be used in the rendered output.
The label need not be unique, and may be the empty string; the
default is in fact the empty string.source§fn node_style(&'a self, _n: &N) -> Style
fn node_style(&'a self, _n: &N) -> Style
n
to a style that will be used in the rendered output.source§fn rank_dir(&'a self) -> Option<RankDir>
fn rank_dir(&'a self) -> Option<RankDir>
source§fn edge_end_arrow(&'a self, _e: &E) -> Arrow
fn edge_end_arrow(&'a self, _e: &E) -> Arrow
e
to arrow style that will be used on the end of an edge.
Defaults to default arrow style.source§fn edge_start_arrow(&'a self, _e: &E) -> Arrow
fn edge_start_arrow(&'a self, _e: &E) -> Arrow
e
to arrow style that will be used on the end of an edge.
Defaults to default arrow style.source§fn edge_style(&'a self, _e: &E) -> Style
fn edge_style(&'a self, _e: &E) -> Style
e
to a style that will be used in the rendered output.source§impl PartialEq<CallString> for CallString
impl PartialEq<CallString> for CallString
source§fn eq(&self, other: &CallString) -> bool
fn eq(&self, other: &CallString) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CallString
impl Serialize for CallString
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
impl Copy for CallString
impl Eq for CallString
impl StructuralEq for CallString
impl StructuralPartialEq for CallString
Auto Trait Implementations§
impl RefUnwindSafe for CallString
impl Send for CallString
impl Sync for CallString
impl Unpin for CallString
impl UnwindSafe for CallString
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.