pub trait WriteStream<E>:
Debug
+ Send
+ Syncwhere
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§
Provided Methods§
fn flush(&mut self) -> Result<(), CuError>
Sourcefn last_log_bytes(&self) -> Option<usize>
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§
impl WriteStream<CuLogEntry> for SimpleFileWriter
Available on crate feature
std only.