pub struct TraceId(/* private fields */);Expand description
W3C Trace Context trace ID (128-bit / 16 bytes).
Used for distributed trace correlation across pipeline components. Formatted as 32 lowercase hex characters per the W3C specification.
§Invariants
- An all-zero trace ID is considered invalid (per W3C spec).
§Examples
use torvyn_types::TraceId;
let id = TraceId::new([0x4b, 0xf9, 0x2f, 0x35, 0x77, 0xb3, 0x4d, 0xa6,
0xa3, 0xce, 0x92, 0x9d, 0x0e, 0x0e, 0x47, 0x36]);
assert!(id.is_valid());
assert_eq!(id.to_string().len(), 32);Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TraceId
impl<'de> Deserialize<'de> for TraceId
Source§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
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