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

source

fn new(locs: Box<[GlobalLocation]>) -> Self

Create a new call string from a list of global locations.

source

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()).

source

pub fn single(loc: GlobalLocation) -> Self

Create an initial call string for the single location loc.

source

pub fn leaf(self) -> GlobalLocation

Returns the leaf of the call string (the currently-called function).

source

pub fn caller(self) -> Option<Self>

Returns the call string minus the leaf. Returns None if this location is at the root.

source

pub fn iter(&self) -> impl DoubleEndedIterator<Item = GlobalLocation> + '_

Returns an iterator over the locations in the call string, starting at the leaf and going to the root.

source

pub fn push(self, loc: GlobalLocation) -> Self

Adds a new call site to the end of the call string.

source

pub fn push_front(self, loc: GlobalLocation) -> Self

source

pub fn is_at_root(self) -> bool

source

pub fn root(self) -> GlobalLocation

source

pub fn stable_id(self) -> usize

source

pub fn iter_from_root( &self ) -> impl DoubleEndedIterator<Item = GlobalLocation> + '_

Returns an iterator over the locations in the call string, starting at the root and going to the leaf.

source

pub fn len(self) -> usize

source

pub fn is_empty(self) -> bool

Trait Implementations§

source§

impl Clone for CallString

source§

fn clone(&self) -> CallString

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CallString

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for CallString

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for CallString

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for CallString

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<CallString> for CallString

source§

fn eq(&self, other: &CallString) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for CallString

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for CallString

source§

impl Eq for CallString

source§

impl StructuralEq for CallString

source§

impl StructuralPartialEq for CallString

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where H: Hash + ?Sized, B: BuildHasher,

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,