pub struct CallString(Intern<Box<[GlobalLocation]>>);
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]>>
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> GraphWalk<'a, CallString, GlobalEdge> for DotPrintableProgramDescription<'_>
impl<'a> GraphWalk<'a, CallString, GlobalEdge> for DotPrintableProgramDescription<'_>
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> Labeller<'a, CallString, GlobalEdge> for DotPrintableProgramDescription<'_>
impl<'a> Labeller<'a, CallString, GlobalEdge> for DotPrintableProgramDescription<'_>
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 for CallString
impl PartialEq for CallString
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 StructuralPartialEq for CallString
Auto Trait Implementations§
impl Freeze for CallString
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<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
key
and return true
if they are equal.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>
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>
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 more