pub struct Tracestate(/* private fields */);
Expand description
The role of Tracestate
is to store and propagate the tracestate header.
It doesn’t currently support any format-aware modification of the underlying value, nor does it parse or validate it.
Implementations§
Source§impl Tracestate
impl Tracestate
Sourcepub const fn new_raw(value: &'static str) -> Tracestate
pub const fn new_raw(value: &'static str) -> Tracestate
Construct a new tracestate with the given value, without checking its validity.
This method is not unsafe. There are no safety properties tied to the validity of tracestate values. Downstream consumers may discard a tracestate value if it’s not valid.
Sourcepub const fn new_str_raw(value: Str<'static>) -> Tracestate
pub const fn new_str_raw(value: Str<'static>) -> Tracestate
Construct a new tracestate with the given value, without checking its validity.
This method is not unsafe. There are no safety properties tied to the validity of tracestate values. Downstream consumers may discard a tracestate value if it’s not valid.
Sourcepub fn new_owned_raw(value: impl Into<Box<str>>) -> Tracestate
pub fn new_owned_raw(value: impl Into<Box<str>>) -> Tracestate
Construct a new tracestate with the given value, without checking its validity.
This method is not unsafe. There are no safety properties tied to the validity of tracestate values. Downstream consumers may discard a tracestate value if it’s not valid.
Sourcepub fn current() -> Self
pub fn current() -> Self
Get the current trace state.
If no context has been set, this method will return an empty value.
Sourcepub fn push(&self) -> Frame<TraceparentCtxt>
pub fn push(&self) -> Frame<TraceparentCtxt>
Get a Frame
that can set the current trace state in a scope.
While the frame is active, Tracestate::current
will return this state.
Trait Implementations§
Source§impl Clone for Tracestate
impl Clone for Tracestate
Source§fn clone(&self) -> Tracestate
fn clone(&self) -> Tracestate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more