Skip to main content

AppendLogSink

Trait AppendLogSink 

Source
pub trait AppendLogSink<T>: Send + Sync {
    // Required methods
    fn append_entries(
        &self,
        entries: &[T],
    ) -> Result<(), Box<dyn Error + Send + Sync>>;
    fn load_entries(&self) -> Result<Vec<T>, Box<dyn Error + Send + Sync>>;
}
Expand description

Trait for append-log storage sinks used by ReactiveLog::attach_storage.

Implementors receive batches of entries and optionally support pre-loading. Methods return Result — errors are swallowed by attach_storage (matches TS try/catch semantics) so a failing tier doesn’t break the reactive graph.

Required Methods§

Source

fn append_entries( &self, entries: &[T], ) -> Result<(), Box<dyn Error + Send + Sync>>

Append entries to persistent storage.

Source

fn load_entries(&self) -> Result<Vec<T>, Box<dyn Error + Send + Sync>>

Load previously stored entries (for pre-loading on startup). Returns an empty vec if no entries are stored.

Implementors§