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) -> Self
pub fn enter(fields: Vec<ScopeField>, tail_capacity: u16) -> Self
Push a Scope frame.
Sourcepub fn enter_context(fields: Vec<ScopeField>) -> Self
pub fn enter_context(fields: Vec<ScopeField>) -> Self
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,
) -> Self
pub fn enter_with_identity( fields: Vec<ScopeField>, kind: ScopeKind, tail_capacity: u16, name: &'static str, target: &'static str, ) -> Self
Push a frame with explicit identity, used by the bridge to
stamp (name, target) for obs::SpanTrace.
Sourcepub fn enter_with_frame(frame: ScopeFrame) -> Self
pub fn enter_with_frame(frame: ScopeFrame) -> Self
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.