Struct slog::drain::AsyncStreamer [] [src]

pub struct AsyncStreamer<F: Format> {
    // some fields omitted
}

Drain formating records and writing them to a byte-stream (io::Write) asynchronously.

Internally, new thread will be spawned taking care of actually writing the data.

Methods

impl<F: Format> AsyncStreamer<F>
[src]

fn new<W: Write + Send + 'static>(io: W, format: F) -> Self

Create new AsyncStreamer writing to io using format

Trait Implementations

impl<F: Format + Send> Drain for AsyncStreamer<F>
[src]

fn log(&self, buf: &mut Vec<u8>, info: &RecordInfo, logger_values: &OwnedKeyValueNode) -> Result<()>

Write one logging record As an optimization (avoiding allocations), loggers are responsible for providing a byte buffer, that Drain can use for their own needs. Read more