Skip to main content

AppendLogStorageTier

Trait AppendLogStorageTier 

Source
pub trait AppendLogStorageTier<T>: BaseStorageTier
where T: Send + Sync + 'static,
{ // Required methods fn append_entries(&self, entries: &[T]) -> Result<(), StorageError>; fn load_entries( &self, opts: LoadEntriesOpts<'_>, ) -> Result<AppendLoadResult<T>, StorageError>; // Provided methods fn mode(&self) -> AppendLogMode { ... } fn load_entries_all( &self, key_filter: Option<&str>, ) -> Result<Vec<T>, StorageError> { ... } }
Expand description

Append-log tier — bulk-friendly entry persistence with optional partitioning via key_of. Mirrors TS AppendLogStorageTier<T>.

Storage shape: each backend key holds a serialized array of all entries for that partition, growing on every flush. Adapters that need true append-only semantics layer their own tier over the same backend.

Required Methods§

Source

fn append_entries(&self, entries: &[T]) -> Result<(), StorageError>

Append entries to the per-key buckets (each bucket determined by the tier’s key_of closure). Honors compact_every cadence.

Source

fn load_entries( &self, opts: LoadEntriesOpts<'_>, ) -> Result<AppendLoadResult<T>, StorageError>

D269 — windowed cursor pagination (memo:Re loadEntries-pagination parity). With LoadEntriesOpts::default() returns the whole log (back-compat shape) and cursor: None. With page_size = Some(n) returns [start, start+n) of the flattened (lex-ASC-by-key, entry-order-within-key) sequence and a forward-only cursor (None ⇒ no more). Pre-D269 callers using load_entries_legacy(key_filter) get the old signature.

Provided Methods§

Source

fn mode(&self) -> AppendLogMode

D269: persistence mode (Append default — read-merge; Overwrite — replace bucket per flush). Exposed so delta-shipping consumers like ReactiveLog::attach_storage can reject Overwrite tiers at attach time.

Source

fn load_entries_all( &self, key_filter: Option<&str>, ) -> Result<Vec<T>, StorageError>

Pre-D269 convenience: load all entries (no pagination, no cursor). Equivalent to load_entries(LoadEntriesOpts { key_filter, .. }).

Implementors§

Source§

impl<B, T, C> AppendLogStorageTier<T> for AppendLogStorage<B, T, C>
where B: StorageBackend + ?Sized, T: Serialize + DeserializeOwned + Clone + Send + Sync + 'static, C: Codec<Vec<T>>,