Struct Current

struct Current { ... }

Indicates what the Subscriber considers the "current" span.

As subscribers may not track a notion of a current span, this has three possible states:

Implementations

impl Current

fn new(id: Id, metadata: &'static Metadata<'static>) -> Self

Constructs a new Current that indicates the current context is a span with the given metadata and metadata.

fn none() -> Self

Constructs a new Current that indicates the current context is not in a span.

fn is_known(self: &Self) -> bool

Returns true if the Subscriber that constructed this Current tracks a current span.

If this returns true and id, metadata, or into_inner return None, that indicates that we are currently known to not be inside a span. If this returns false, those methods will also return None, but in this case, that is because the subscriber does not keep track of the currently-entered span.

fn into_inner(self: Self) -> Option<(Id, &'static Metadata<'static>)>

Consumes self and returns the span Id and Metadata of the current span, if one exists and is known.

fn id(self: &Self) -> Option<&Id>

Borrows the Id of the current span, if one exists and is known.

fn metadata(self: &Self) -> Option<&'static Metadata<'static>>

Borrows the Metadata of the current span, if one exists and is known.

impl Debug for Current

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

impl Freeze for Current

impl RefUnwindSafe for Current

impl Send for Current

impl Sync for Current

impl Unpin for Current

impl UnsafeUnpin for Current

impl UnwindSafe for Current

impl<T> Any for Current

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Current

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

impl<T> BorrowMut for Current

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

impl<T> From for Current

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Current

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 Current

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

impl<T, U> TryInto for Current

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