Struct Streamer

Source
pub struct Streamer<W: Write, F: Format> { /* private fields */ }
Expand description

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

Uses mutex to serialize writes to io. Use AsyncStreamer for better performance, but without guarantee of immediate output.

Implementations§

Source§

impl<W: Write, F: Format> Streamer<W, F>

Source

pub fn new(io: W, format: F) -> Self

Create new Streamer writing to io using format

Trait Implementations§

Source§

impl<W: 'static + Write + Send, F: Format + Send> Drain for Streamer<W, F>

Source§

type Error = Error

Type of potential errors returned during logging
Source§

fn log( &self, info: &Record<'_>, logger_values: &OwnedKeyValueList, ) -> Result<()>

Log one logging record Read more

Auto Trait Implementations§

§

impl<W, F> !Freeze for Streamer<W, F>

§

impl<W, F> RefUnwindSafe for Streamer<W, F>
where F: RefUnwindSafe,

§

impl<W, F> Send for Streamer<W, F>
where W: Send,

§

impl<W, F> Sync for Streamer<W, F>
where W: Send,

§

impl<W, F> Unpin for Streamer<W, F>
where F: Unpin, W: Unpin,

§

impl<W, F> UnwindSafe for Streamer<W, F>
where F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<D> DrainExt for D
where D: Drain,

Source§

fn map_err<F, E>(self, f: F) -> MapError<Self, E>
where F: 'static + Sync + Send + Fn(Self::Error) -> E,

Map logging errors returned by this drain Read more
Source§

fn ignore_err(self) -> IgnoreErr<Self>

Make Self ignore and not report any error
Source§

fn fuse(self) -> Fuse<Self>
where Self::Error: Display,

Make Self panic when returning any errors
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.