pub trait Store: Send + Sync {
// Required method
fn save(&self, json: &str) -> Result<()>;
// Provided method
fn lock(&self) -> Result<Option<Locked>> { ... }
}Expand description
Required Methods§
Provided Methods§
Sourcefn lock(&self) -> Result<Option<Locked>>
fn lock(&self) -> Result<Option<Locked>>
Locks the store against other processes and reads what is saved in it, for a store more than one process writes. A purse calls it before every change: it makes the change to what was read here, saves, and only then drops the lock, so it never saves over a change another process made since it last looked.
The default returns None, for a store only one purse writes: the
purse’s own holder is then always current.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".