Skip to main content

WriteStream

Trait WriteStream 

Source
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§

Source

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

Provided Methods§

Source

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

Source

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

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl WriteStream<CuLogEntry> for SimpleFileWriter

Available on crate feature std only.
Source§

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