Skip to main content

AppendLogStorage

Struct AppendLogStorage 

Source
pub struct AppendLogStorage<B, T, C = JsonCodec>
where B: StorageBackend + ?Sized, T: Serialize + DeserializeOwned + Clone + Send + Sync + 'static, C: Codec<Vec<T>>,
{ /* private fields */ }
Expand description

Append-log tier — buffers per-key entries; flush() encodes each bucket as an array via codec and merge-writes it into the backend. Mirrors TS appendLogStorage.

Trait Implementations§

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>>,

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 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( &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.
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, .. }).
Source§

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

Source§

fn name(&self) -> &str

Diagnostic tier name (e.g. "snapshot:my-graph"). Surfaces in error messages and Display impls.
Source§

fn debounce_ms(&self) -> Option<u32>

Debounce window in milliseconds. None (default) = sync-through. Graph-layer attach reads this and schedules timed flush() via its own reactive timer (M4.E); the tier itself does NOT drive a timer.
Source§

fn compact_every(&self) -> Option<u32>

Force a flush every Nth accepted write regardless of debounce. None = no cap; Some(N) triggers flush() on the Nth save (or append_entries for log tiers).
Source§

fn flush(&self) -> Result<(), StorageError>

Commit pending writes. Graph calls at wave-close / debounce-fire.
Source§

fn rollback(&self) -> Result<(), StorageError>

Discard pending writes. Graph calls on wave-throw.
Source§

fn list_by_prefix_bytes<'a>( &'a self, prefix: &str, ) -> Box<dyn Iterator<Item = Result<(String, Vec<u8>), StorageError>> + 'a>

Lazily enumerate raw (key, bytes) pairs under a literal byte-prefix (DS-14-storage Q5 lock). Read more
Source§

fn compact(&self) -> Result<(), StorageError>

Force a mode:"full" baseline immediately (Q8 lock). Bypasses compact_every cadence; useful at deploy boundaries, end-of-process drains, or test fixtures. Default impl is a flush() so tiers that don’t write baselines can still implement the method trivially.

Auto Trait Implementations§

§

impl<B, T, C = JsonCodec> !Freeze for AppendLogStorage<B, T, C>

§

impl<B, T, C = JsonCodec> !RefUnwindSafe for AppendLogStorage<B, T, C>

§

impl<B, T, C> Send for AppendLogStorage<B, T, C>
where B: ?Sized,

§

impl<B, T, C> Sync for AppendLogStorage<B, T, C>
where B: ?Sized,

§

impl<B, T, C> Unpin for AppendLogStorage<B, T, C>
where C: Unpin, T: Unpin, B: ?Sized,

§

impl<B, T, C> UnsafeUnpin for AppendLogStorage<B, T, C>
where C: UnsafeUnpin, B: ?Sized,

§

impl<B, T, C = JsonCodec> !UnwindSafe for AppendLogStorage<B, T, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.