pub struct Id(/* private fields */);
Expand description
Identifies a span within the context of a subscriber.
They are generated by Subscriber
s for each span as it is created, by
the new_span
trait method. See the documentation for that method for
more information on span ID generation.
Implementations§
Source§impl Id
impl Id
Sourcepub fn from_u64(u: u64) -> Id
pub fn from_u64(u: u64) -> Id
Constructs a new span ID from the given u64
.
Note: Span IDs must be greater than zero.
§Panics
- If the provided
u64
is 0.
Sourcepub const fn from_non_zero_u64(id: NonZero<u64>) -> Id
pub const fn from_non_zero_u64(id: NonZero<u64>) -> Id
Constructs a new span ID from the given NonZeroU64
.
Unlike Id::from_u64
, this will never panic.
Sourcepub const fn into_non_zero_u64(&self) -> NonZero<u64>
pub const fn into_non_zero_u64(&self) -> NonZero<u64>
Returns the span’s ID as a NonZeroU64
.
Trait Implementations§
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
Available on crate feature
std
only.Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Available on crate feature
std
only.