pub struct ScopeGuard { /* private fields */ }Expand description
RAII guard returned by obs::scope! and obs::context!. Dropping
pops the frame; for Scope kind frames where any >= ERROR
envelope was observed, the tail buffer is flushed back through the
active observer with sampling_reason = TAIL_ERROR.
Implementations§
Source§impl ScopeGuard
impl ScopeGuard
Sourcepub fn enter(fields: Vec<ScopeField>, tail_capacity: u16) -> ScopeGuard
pub fn enter(fields: Vec<ScopeField>, tail_capacity: u16) -> ScopeGuard
Push a Scope frame.
Sourcepub fn enter_context(fields: Vec<ScopeField>) -> ScopeGuard
pub fn enter_context(fields: Vec<ScopeField>) -> ScopeGuard
Push a Context frame (no tail buffer).
Sourcepub fn enter_with_identity(
fields: Vec<ScopeField>,
kind: ScopeKind,
tail_capacity: u16,
name: &'static str,
target: &'static str,
) -> ScopeGuard
pub fn enter_with_identity( fields: Vec<ScopeField>, kind: ScopeKind, tail_capacity: u16, name: &'static str, target: &'static str, ) -> ScopeGuard
Push a frame with explicit identity, used by the bridge to
stamp (name, target) for obs::SpanTrace.
Sourcepub fn enter_with_frame(frame: ScopeFrame) -> ScopeGuard
pub fn enter_with_frame(frame: ScopeFrame) -> ScopeGuard
Push a fully-built ScopeFrame onto the active scope stack.
Used by super::ScopeFrameBuilder::push so external crates
can build a frame programmatically (instead of via the
obs::scope! macro) and own the resulting RAII guard.
Spec 94 D7-3.
Sourcepub fn into_inner(self) -> ScopeFrame
pub fn into_inner(self) -> ScopeFrame
Detach the guard so the caller can layer it onto a
Future::instrument(...) (the future then re-applies the frame
on every poll). The frame is popped immediately so the caller
doesn’t hold two copies.
Trait Implementations§
Source§impl Debug for ScopeGuard
impl Debug for ScopeGuard
Source§impl Drop for ScopeGuard
impl Drop for ScopeGuard
Auto Trait Implementations§
impl Freeze for ScopeGuard
impl RefUnwindSafe for ScopeGuard
impl Send for ScopeGuard
impl Sync for ScopeGuard
impl Unpin for ScopeGuard
impl UnsafeUnpin for ScopeGuard
impl UnwindSafe for ScopeGuard
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request