pub struct Context<E: ContextElement> { /* private fields */ }Expand description
A context is composed of a list of context elements, e.g. callsites.
Implementations§
source§impl<E: ContextElement> Context<E>
impl<E: ContextElement> Context<E>
pub fn new_empty() -> Rc<Self>
pub fn new(context_elems: Vec<E>) -> Rc<Self>
pub fn len(&self) -> usize
sourcepub fn new_k_limited_context(
old_ctx: &Rc<Context<E>>,
elem: E,
k: usize
) -> Rc<Self>
pub fn new_k_limited_context( old_ctx: &Rc<Context<E>>, elem: E, k: usize ) -> Rc<Self>
Composes a new context from a given context and a new context element. Discard the last old context element if the length of context exceeds the depth limit.
pub fn k_limited_context(ctx: &Rc<Context<E>>, k: usize) -> Rc<Self>
pub fn first_context_element(&self) -> Option<&E>
pub fn last_context_element(&self) -> Option<&E>
Trait Implementations§
source§impl<E: ContextElement> Debug for Context<E>
impl<E: ContextElement> Debug for Context<E>
source§impl<E: PartialEq + ContextElement> PartialEq for Context<E>
impl<E: PartialEq + ContextElement> PartialEq for Context<E>
impl<E: Eq + ContextElement> Eq for Context<E>
impl<E: ContextElement> StructuralPartialEq for Context<E>
Auto Trait Implementations§
impl<E> RefUnwindSafe for Context<E>where
E: RefUnwindSafe,
impl<E> Send for Context<E>where
E: Send,
impl<E> Sync for Context<E>where
E: Sync,
impl<E> Unpin for Context<E>where
E: Unpin,
impl<E> UnwindSafe for Context<E>where
E: UnwindSafe,
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<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.