pub trait StoreBackend:
Send
+ Sync
+ 'static {
// Required methods
fn load(&self, store_id: &str, device_id: &str) -> Option<(Vec<u8>, u64)>;
fn save(&self, store_id: &str, device_id: &str, data: &[u8], version: u64);
fn remove(&self, store_id: &str, device_id: &str);
}Expand description
Backend for persisting store data across restarts.
Methods are synchronous — file I/O for small JSON payloads is fast enough that async overhead isn’t warranted. Apps needing async persistence (e.g., database-backed) can spawn a blocking task internally.
Required Methods§
Sourcefn load(&self, store_id: &str, device_id: &str) -> Option<(Vec<u8>, u64)>
fn load(&self, store_id: &str, device_id: &str) -> Option<(Vec<u8>, u64)>
Load a device’s slice. Returns (serialized_data, version) or None.