Struct opentelemetry::trace::TraceId
source · [−]pub struct TraceId(_);
This is supported on crate feature
trace
only.Expand description
A 16-byte value which identifies a given trace.
The id is valid if it contains at least one non-zero byte.
Implementations
Create a trace id from its representation as a byte array.
Return the representation of this trace id as a byte array.
Converts a string in base 16 to a trace id.
Examples
use opentelemetry::trace::TraceId;
assert!(TraceId::from_hex("42").is_ok());
assert!(TraceId::from_hex("58406520a006649127e371903a2de979").is_ok());
assert!(TraceId::from_hex("not_hex").is_err());
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for TraceId
impl UnwindSafe for TraceId
Blanket Implementations
Mutably borrows from an owned value. Read more