pub struct Metadata { /* private fields */ }Expand description
Extensible message metadata: W3C-style trace context plus a small string baggage map. Empty by default and cheap to clone (the baggage map does not allocate until the first insert).
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn with_trace(
trace_id: impl Into<String>,
span_id: impl Into<String>,
) -> Self
pub fn with_trace( trace_id: impl Into<String>, span_id: impl Into<String>, ) -> Self
Construct with a trace + span id.
Sourcepub fn set_trace_id(&mut self, trace_id: impl Into<String>)
pub fn set_trace_id(&mut self, trace_id: impl Into<String>)
Set the trace id.
Sourcepub fn set_span_id(&mut self, span_id: impl Into<String>)
pub fn set_span_id(&mut self, span_id: impl Into<String>)
Set the span id.
Sourcepub fn set_baggage(&mut self, key: impl Into<String>, value: impl Into<String>)
pub fn set_baggage(&mut self, key: impl Into<String>, value: impl Into<String>)
Insert a baggage key/value.
Sourcepub fn baggage_iter(&self) -> impl Iterator<Item = (&str, &str)>
pub fn baggage_iter(&self) -> impl Iterator<Item = (&str, &str)>
Iterate baggage entries (e.g. to serialize on a remote hop).
Trait Implementations§
impl Eq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnsafeUnpin for Metadata
impl UnwindSafe for Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.