Skip to main content

FileLogSink

Trait FileLogSink 

Source
pub trait FileLogSink<E> {
    // Required methods
    fn self_id(&self) -> Uuid;
    fn write(&mut self, entries: &[(u64, LogEntry<E>)]) -> Result<(), SyncError>;
}
Expand description

Write side of a file log: append to your own origin only. No method writes a foreign origin — that’s the single-writer invariant. The caller supplies each entry’s index (the oplog assigns them; the file log follows).

Required Methods§

Source

fn self_id(&self) -> Uuid

The origin this sink writes — the local node’s id.

Source

fn write(&mut self, entries: &[(u64, LogEntry<E>)]) -> Result<(), SyncError>

Append entries at their given indices; batched so one call can be one segment write. Real entries only — expunging rewrites an existing segment, it never appends.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§