Skip to main content

StorageBackend

Trait StorageBackend 

Source
pub trait StorageBackend: Send + Sync {
    // Required methods
    fn load(&self) -> Result<BTreeMap<String, String>, String>;
    fn write(&self, change: StorageChange);
}
Expand description

Where an app’s entries are kept: the platform’s.

Required Methods§

Source

fn load(&self) -> Result<BTreeMap<String, String>, String>

The entries kept, read once when the app first uses its storage; an error leaves the app with none (logged).

Source

fn write(&self, change: StorageChange)

Keeps change. Called on the engine thread: a backend that blocks writes elsewhere, in order.

Trait Implementations§

Source§

impl Debug for dyn StorageBackend

Names the backend only, so that platforms’ options holding one can derive Debug.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§