Trait tracing_subscriber::fmt::writer::MakeWriter [−][src]
A type that can create io::Write
instances.
MakeWriter
is used by fmt::Subscriber
or fmt::Layer
to print formatted text representations of
Event
s.
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
[src]
The concrete io::Write
implementation returned by make_writer
.
Required methods
fn make_writer(&self) -> Self::Writer
[src]
Returns an instance of Writer
.
Implementer notes
fmt::Layer
or fmt::Subscriber
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.
Implementors
impl MakeWriter for TestWriter
[src]
type Writer = Self
fn make_writer(&self) -> Self::Writer
[src]
impl MakeWriter for BoxMakeWriter
[src]
impl<F, W> MakeWriter for F where
F: Fn() -> W,
W: Write,
[src]
F: Fn() -> W,
W: Write,