Skip to main content

LocalStore

Trait LocalStore 

Source
pub trait LocalStore<T>: Send + Sync {
    // Required methods
    fn all(&self) -> SyncResult<Vec<T>>;
    fn remove(&self, id: &str) -> SyncResult<()>;
    fn apply_remote(&self, items: &[T]) -> SyncResult<Vec<ApplyOutcome>>;
}
Expand description

The app’s local data. All calls are synchronous.

Required Methods§

Source

fn all(&self) -> SyncResult<Vec<T>>

Source

fn remove(&self, id: &str) -> SyncResult<()>

Remove a locally held item because of a tombstone. Idempotent.

Source

fn apply_remote(&self, items: &[T]) -> SyncResult<Vec<ApplyOutcome>>

Upsert downloaded items; one outcome per input, in order. Err aborts the pass WITHOUT advancing the change token.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§