pub struct Context { /* private fields */ }
Expand description
The thread-local callback context for #[trace]
.
Implementations§
Source§impl Context
impl Context
Sourcepub fn default_callback(ctx: &mut Context, event: Event)
pub fn default_callback(ctx: &mut Context, event: Event)
The default callback registered by Self::new()
.
Sourcepub fn stack(&self) -> &[CallContext]
pub fn stack(&self) -> &[CallContext]
Returns the current call stack.
Sourcepub fn top(&self) -> &CallContext
pub fn top(&self) -> &CallContext
Returns the top of the current call stack.
Sourcepub fn register_callback<F, G>(&mut self, f: F)
pub fn register_callback<F, G>(&mut self, f: F)
Registers a callback. A previously registered callback is passed to the outer closure.
Sourcepub fn unregister_callback(&mut self) -> Option<Callback>
pub fn unregister_callback(&mut self) -> Option<Callback>
Unregisters a callback.
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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