pub struct MemoryStore { /* private fields */ }Expand description
A store in memory, lost when the process ends. For tests, and for applications that persist the JSON themselves.
Implementations§
Trait Implementations§
Source§impl Debug for MemoryStore
impl Debug for MemoryStore
Source§impl Default for MemoryStore
impl Default for MemoryStore
Source§fn default() -> MemoryStore
fn default() -> MemoryStore
Returns the “default value” for a type. Read more
Source§impl Store for MemoryStore
impl Store for MemoryStore
Source§fn save(&self, json: &str) -> Result<()>
fn save(&self, json: &str) -> Result<()>
Replaces what was saved with
json. Returns only once the data
would survive a crash: the purse hands out keys and transfers only
after this succeeds.Source§fn 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. Read more
Auto Trait Implementations§
impl !Freeze for MemoryStore
impl RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
impl UnwindSafe for MemoryStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more