Struct tracing_core::span::Current [−][src]
Indicates what the collector considers the “current” span.
As collectors may not track a notion of a current span, this has three possible states:
Implementations
impl Current
[src]
pub fn new(id: Id, metadata: &'static Metadata<'static>) -> Self
[src]
Constructs a new Current
that indicates the current context is a span
with the given metadata
and metadata
.
pub fn none() -> Self
[src]
Constructs a new Current
that indicates the current context is not
in a span.
pub fn is_known(&self) -> bool
[src]
Returns true
if the collector 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 collector does not keep
track of the currently-entered span.
pub fn into_inner(self) -> Option<(Id, &'static Metadata<'static>)>
[src]
Consumes self
and returns the span Id
and Metadata
of the current
span, if one exists and is known.
pub fn id(&self) -> Option<&Id>
[src]
Borrows the Id
of the current span, if one exists and is known.
pub fn metadata(&self) -> Option<&'static Metadata<'static>>
[src]
Borrows the Metadata
of the current span, if one exists and is known.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Current
impl Send for Current
impl Sync for Current
impl Unpin for Current
impl !UnwindSafe for Current
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,