Struct Id

struct Id(_)

Identifies a span within the context of a subscriber.

They are generated by Subscribers 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

impl Id

fn from_u64(u: u64) -> Self

Constructs a new span ID from the given u64.

    Note: Span IDs must be greater than zero.

Panics

  • If the provided u64 is 0.
const fn from_non_zero_u64(id: NonZeroU64) -> Self

Constructs a new span ID from the given NonZeroU64.

Unlike Id::from_u64, this will never panic.

fn into_u64(self: &Self) -> u64

Returns the span's ID as a u64.

const fn into_non_zero_u64(self: &Self) -> NonZeroU64

Returns the span's ID as a NonZeroU64.

impl Clone for Id

fn clone(self: &Self) -> Id

impl Debug for Id

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Eq for Id

impl Freeze for Id

impl Hash for Id

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl PartialEq for Id

fn eq(self: &Self, other: &Id) -> bool

impl RefUnwindSafe for Id

impl Send for Id

impl StructuralPartialEq for Id

impl Sync for Id

impl Unpin for Id

impl UnsafeUnpin for Id

impl UnwindSafe for Id

impl<T> Any for Id

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Id

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Id

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Id

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Id

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Id

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Id

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Id

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Id

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>