Struct ThreadLocalEncoder
pub struct ThreadLocalEncoder<'a> { /* private fields */ }dial9 only.Expand description
Scoped encoder for writing events into the thread-local trace buffer.
Provides access to string interning and event encoding. The borrow lifetime
ensures that InternedString handles created via intern_string
are used within the same batch — they become invalid after the buffer flushes.
You don’t construct this directly; it’s passed to Encodable::encode.
Implementations§
§impl ThreadLocalEncoder<'_>
impl ThreadLocalEncoder<'_>
pub fn intern_string(&mut self, s: &str) -> InternedString
pub fn intern_string(&mut self, s: &str) -> InternedString
Intern a string into the trace’s string pool, returning a compact handle.
If the string was already interned in this batch, returns the existing handle
(no duplicate wire data). The returned InternedString is only valid for
encoding within this same Encodable::encode call.
pub fn intern_stack_frames(&mut self, frames: &[u64]) -> InternedStackFrames
pub fn intern_stack_frames(&mut self, frames: &[u64]) -> InternedStackFrames
Intern a stack-frame vector into the trace’s stack pool, returning a compact handle.
If the stack was already interned in this batch, returns the existing handle
(no duplicate wire data). The returned InternedStackFrames is only valid for
encoding within this same Encodable::encode call.
pub fn encode(&mut self, event: &impl TraceEvent)
pub fn encode(&mut self, event: &impl TraceEvent)
Encode a TraceEvent struct into the buffer.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !UnwindSafe for ThreadLocalEncoder<'a>
impl<'a> Freeze for ThreadLocalEncoder<'a>
impl<'a> RefUnwindSafe for ThreadLocalEncoder<'a>
impl<'a> Send for ThreadLocalEncoder<'a>
impl<'a> Sync for ThreadLocalEncoder<'a>
impl<'a> Unpin for ThreadLocalEncoder<'a>
impl<'a> UnsafeUnpin for ThreadLocalEncoder<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more