[][src]Struct tracing_fmt::Context

pub struct Context<'a, N> where
    N: 'a, 
{ /* fields omitted */ }

Represents the Subscriber's view of the current span context to a formatter.

Methods

impl<'a, N> Context<'a, N>[src]

pub fn visit_spans<F, E>(&self, f: F) -> Result<(), E> where
    F: FnMut(&Id, Span) -> Result<(), E>, 
[src]

Applies a function to each span in the current trace context.

The function is applied in order, beginning with the root of the trace, and ending with the current span. If the function returns an error, this will short-circuit.

If invoked from outside of a span, the function will not be applied.

Note that if we are currently unwinding, this will do nothing, rather than potentially causing a double panic.

pub fn with_current<F, R>(&self, f: F) -> Option<R> where
    F: FnOnce((&Id, Span)) -> R, 
[src]

Executes a closure with the reference to the current span.

pub fn new_visitor<'writer>(
    &self,
    writer: &'writer mut (dyn Write + 'writer),
    is_empty: bool
) -> <N as NewVisitor<'writer>>::Visitor where
    N: NewVisitor<'writer>, 
[src]

Returns a new visitor that formats span fields to the provided writer. The visitor configuration is provided by the subscriber.

Trait Implementations

impl<'a, N> Debug for Context<'a, N> where
    N: Debug
[src]

Auto Trait Implementations

impl<'a, N> Send for Context<'a, N> where
    N: Sync

impl<'a, N> Unpin for Context<'a, N>

impl<'a, N> Sync for Context<'a, N> where
    N: Sync

impl<'a, N> !UnwindSafe for Context<'a, N>

impl<'a, N> !RefUnwindSafe for Context<'a, N>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T