pub struct SpanGuard { /* private fields */ }Expand description
Span guard that automatically ends spans when dropped
Implementations§
Source§impl SpanGuard
impl SpanGuard
pub fn new(span_id: String, plugin: Arc<dyn ObservabilityPlugin>) -> Self
pub fn no_op() -> Self
pub fn span_id(&self) -> &str
pub fn duration(&self) -> Duration
pub fn add_attribute(&self, key: &str, value: &str)
pub fn set_status(&self, status: SpanStatus)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpanGuard
impl !RefUnwindSafe for SpanGuard
impl Send for SpanGuard
impl Sync for SpanGuard
impl Unpin for SpanGuard
impl UnsafeUnpin for SpanGuard
impl !UnwindSafe for SpanGuard
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