[][src]Struct tracing_appender::non_blocking::NonBlocking

pub struct NonBlocking { /* fields omitted */ }

A non-blocking writer.

While the line between "blocking" and "non-blocking" IO is fuzzy, writing to a file is typically considered to be a blocking operation. For an application whose Subscriber writes spans and events as they are emitted, an application might find the latency profile to be unacceptable. NonBlocking moves the writing out of an application's data path by sending spans and events to a dedicated logging thread.

This struct implements MakeWriter from the tracing-subscriber crate. Therefore, it can be used with the tracing_subscriber::fmt module or with any other subscriber/layer implementation that uses the MakeWriter trait.

Methods

impl NonBlocking[src]

pub fn new<T: Write + Send + Sync + 'static>(
    writer: T
) -> (NonBlocking, WorkerGuard)
[src]

Returns a new NonBlocking writer wrapping the provided writer.

The returned NonBlocking writer will have the default configuration values. Other configurations can be specified using the builder interface.

pub fn error_counter(&self) -> Arc<AtomicU64>[src]

Returns a counter for the number of times logs where dropped. This will always return zero if NonBlocking is not lossy.

Trait Implementations

impl Clone for NonBlocking[src]

impl Debug for NonBlocking[src]

impl MakeWriter for NonBlocking[src]

type Writer = NonBlocking

The concrete [io::Write] implementation returned by [make_writer]. Read more

impl Write for NonBlocking[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<F, W> MakeWriter for F where
    F: Fn() -> W,
    W: Write
[src]

type Writer = W

The concrete [io::Write] implementation returned by [make_writer]. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.