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>) -> SelfConstructs a new
Currentthat indicates the current context is a span with the givenmetadataandmetadata.fn none() -> SelfConstructs a new
Currentthat indicates the current context is not in a span.fn is_known(self: &Self) -> boolReturns
trueif theSubscriberthat constructed thisCurrenttracks a current span.If this returns
trueandid,metadata, orinto_innerreturnNone, that indicates that we are currently known to not be inside a span. If this returnsfalse, those methods will also returnNone, 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
selfand returns the spanIdandMetadataof the current span, if one exists and is known.fn id(self: &Self) -> Option<&Id>Borrows the
Idof the current span, if one exists and is known.fn metadata(self: &Self) -> Option<&'static Metadata<'static>>Borrows the
Metadataof 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) -> TReturns the argument unchanged.
impl<T, U> Into for Current
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses 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>