Skip to main content

WriteStream

Trait WriteStream 

pub trait WriteStream<E>:
    Debug
    + Send
    + Sync
where E: Encode,
{ // Required method fn log(&mut self, obj: &E) -> Result<(), CuError>; // Provided methods fn flush(&mut self) -> Result<(), CuError> { ... } fn last_log_bytes(&self) -> Option<usize> { ... } }
Expand description

Defines a basic write, append only stream trait to be able to log or send serializable objects.

Required Methods§

fn log(&mut self, obj: &E) -> Result<(), CuError>

Provided Methods§

fn flush(&mut self) -> Result<(), CuError>

fn last_log_bytes(&self) -> Option<usize>

Optional byte count of the last successful log call, if the implementation can report it.

Implementors§

§

impl WriteStream<CuLogEntry> for SimpleFileWriter

Available on crate feature std only.
§

impl<E, S, L> WriteStream<E> for LogStream<S, L>