Struct TraceId
pub struct TraceId(/* private fields */);
Available on crate feature
opentelemetry
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§
§impl TraceId
impl TraceId
pub const fn from_bytes(bytes: [u8; 16]) -> TraceId
pub const fn from_bytes(bytes: [u8; 16]) -> TraceId
Create a trace id from its representation as a byte array.
pub fn from_hex(hex: &str) -> Result<TraceId, ParseIntError>
pub fn from_hex(hex: &str) -> Result<TraceId, ParseIntError>
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§
impl Copy for TraceId
impl Eq for TraceId
impl StructuralPartialEq for TraceId
Auto Trait Implementations§
impl Freeze for TraceId
impl RefUnwindSafe for TraceId
impl Send for TraceId
impl Sync for TraceId
impl Unpin for TraceId
impl UnwindSafe for TraceId
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.