Trait LogExt

Source
pub trait LogExt: Log {
    // Provided method
    fn flush_to(&self, w: &mut impl Write) -> Result<()> { ... }
}
Expand description

Extension methods for Log.

Provided Methods§

Source

fn flush_to(&self, w: &mut impl Write) -> Result<()>

Available on crate feature std only.

Flushes the whole log to the given writer.

§Example
use valog::{sync::ValueLog, Builder, Log, LogExt};

let log = Builder::new()
  .with_capacity(100)
  .alloc::<ValueLog>(1)
  .unwrap();

let mut buf = Vec::new();
log.flush_to(&mut buf).unwrap();
let data_offset = log.data_offset();
assert_eq!(buf.len(), data_offset);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<L: Log> LogExt for L