[][src]Trait tracing_subscriber::fmt::MakeWriter

pub trait MakeWriter {
    type Writer: Write;
    fn make_writer(&self) -> Self::Writer;
}

A type that can create io::Write instances.

MakeWriter is used by FmtSubscriber to print formatted text representations of Events.

This trait is already implemented for function pointers and immutably-borrowing closures that return an instance of io::Write, such as io::stdout and io::stderr.

Associated Types

type Writer: Write

The concrete io::Write implementation returned by make_writer.

Loading content...

Required methods

fn make_writer(&self) -> Self::Writer

Returns an instance of Writer.

Implementer notes

FmtSubscriber will call this method each time an event is recorded. Ensure any state that must be saved across writes is not lost when the Writer instance is dropped. If creating a io::Write instance is expensive, be sure to cache it when implementing MakeWriter to improve performance.

Loading content...

Implementors

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

type Writer = W

Loading content...