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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§