pub struct ContextScope<'a> { /* private fields */ }Expand description
Context scope for automatic span management
Implementations§
Source§impl<'a> ContextScope<'a>
impl<'a> ContextScope<'a>
Sourcepub fn new(
store: &'a ContextStore,
ctx: &Context,
name: &str,
node_id: NodeId,
) -> Self
pub fn new( store: &'a ContextStore, ctx: &Context, name: &str, node_id: NodeId, ) -> Self
Create a new scope that automatically records a span on drop
Sourcepub fn set_attribute(
&mut self,
key: impl Into<String>,
value: impl Into<AttributeValue>,
)
pub fn set_attribute( &mut self, key: impl Into<String>, value: impl Into<AttributeValue>, )
Set an attribute on the underlying span
Sourcepub fn add_event(&mut self, name: impl Into<String>)
pub fn add_event(&mut self, name: impl Into<String>)
Record a named event on the underlying span
Trait Implementations§
Source§impl<'a> Drop for ContextScope<'a>
impl<'a> Drop for ContextScope<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ContextScope<'a>
impl<'a> !UnwindSafe for ContextScope<'a>
impl<'a> Freeze for ContextScope<'a>
impl<'a> Send for ContextScope<'a>
impl<'a> Sync for ContextScope<'a>
impl<'a> Unpin for ContextScope<'a>
impl<'a> UnsafeUnpin for ContextScope<'a>
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