Skip to main content

WriteStream

Trait WriteStream 

Source
pub trait WriteStream<E: Encode>:
    Debug
    + Send
    + Sync {
    // Required method
    fn log(&mut self, obj: &E) -> CuResult<()>;

    // Provided methods
    fn flush(&mut self) -> CuResult<()> { ... }
    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) -> CuResult<()>

Provided Methods§

Source

fn flush(&mut self) -> CuResult<()>

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§