pub struct MemoryDatastore { /* private fields */ }
Expand description
An in-memory datastore.
Implementations§
Source§impl MemoryDatastore
impl MemoryDatastore
Sourcepub fn new_db() -> Database<MemoryDatastore>
pub fn new_db() -> Database<MemoryDatastore>
Creates a new in-memory database with no persistence.
Sourcepub fn read_msgpack_db<P: Into<PathBuf>>(
path: P,
) -> StdResult<Database<MemoryDatastore>, RmpDecodeError>
pub fn read_msgpack_db<P: Into<PathBuf>>( path: P, ) -> StdResult<Database<MemoryDatastore>, RmpDecodeError>
Reads a persisted image from disk. Calls to sync will overwrite the file at the specified path.
§Arguments
path
: The path to the persisted image.
Sourcepub fn create_msgpack_db<P: Into<PathBuf>>(path: P) -> Database<MemoryDatastore>
pub fn create_msgpack_db<P: Into<PathBuf>>(path: P) -> Database<MemoryDatastore>
Creates a new datastore. Calls to sync will overwrite the file at the
specified path, but as opposed to read
, this will not read the file
first.
§Arguments
path
: The path to the persisted image.
Trait Implementations§
Source§impl Clone for MemoryDatastore
impl Clone for MemoryDatastore
Source§fn clone(&self) -> MemoryDatastore
fn clone(&self) -> MemoryDatastore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Datastore for MemoryDatastore
impl Datastore for MemoryDatastore
Source§type Transaction<'a> = MemoryTransaction<'a>
type Transaction<'a> = MemoryTransaction<'a>
The datastore transaction type.
Source§fn transaction(&self) -> Self::Transaction<'_>
fn transaction(&self) -> Self::Transaction<'_>
Creates a new transaction.
Auto Trait Implementations§
impl Freeze for MemoryDatastore
impl RefUnwindSafe for MemoryDatastore
impl Send for MemoryDatastore
impl Sync for MemoryDatastore
impl Unpin for MemoryDatastore
impl UnwindSafe for MemoryDatastore
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