[−][src]Struct tracing_subscriber::fmt::Context
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]
F: FnMut(&Id, Span) -> Result<(), E>,
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]
F: FnOnce((&Id, Span)) -> R,
Executes a closure with the reference to the current span.
pub fn new_visitor<'writer>(
&self,
writer: &'writer mut dyn Write,
is_empty: bool
) -> N::Visitor where
N: NewVisitor<'writer>,
[src]
&self,
writer: &'writer mut dyn Write,
is_empty: bool
) -> N::Visitor where
N: NewVisitor<'writer>,
Returns a new visitor that formats span fields to the provided writer. The visitor configuration is provided by the subscriber.
Trait Implementations
Auto Trait Implementations
impl<'a, N> Send for Context<'a, N> where
N: Sync,
N: Sync,
impl<'a, N> Sync for Context<'a, N> where
N: Sync,
N: Sync,
impl<'a, N> Unpin for Context<'a, N>
impl<'a, N> UnwindSafe for Context<'a, N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<'a, N> RefUnwindSafe for Context<'a, N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,