pub struct MemStorage { /* private fields */ }Expand description
In-memory Storage: two byte buffers, no failure modes.
The reference implementation for tests and for ephemeral databases (an agent’s scratch memory that intentionally dies with the process).
Implementations§
Source§impl MemStorage
impl MemStorage
Trait Implementations§
Source§impl Clone for MemStorage
impl Clone for MemStorage
Source§fn clone(&self) -> MemStorage
fn clone(&self) -> MemStorage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemStorage
impl Debug for MemStorage
Source§impl Default for MemStorage
impl Default for MemStorage
Source§fn default() -> MemStorage
fn default() -> MemStorage
Returns the “default value” for a type. Read more
impl Eq for MemStorage
Source§impl PartialEq for MemStorage
impl PartialEq for MemStorage
Source§impl Storage for MemStorage
impl Storage for MemStorage
Source§type Error = Infallible
type Error = Infallible
Implementation-specific failure (I/O error, host callback error…).
Source§fn read_snapshot(&mut self) -> Result<Option<Vec<u8>>, Self::Error>
fn read_snapshot(&mut self) -> Result<Option<Vec<u8>>, Self::Error>
The full snapshot image, or
None when no database exists yet
(first run).Source§fn write_snapshot(&mut self, bytes: &[u8]) -> Result<(), Self::Error>
fn write_snapshot(&mut self, bytes: &[u8]) -> Result<(), Self::Error>
Atomically replaces the snapshot image.
Source§fn read_journal(&mut self) -> Result<Vec<u8>, Self::Error>
fn read_journal(&mut self) -> Result<Vec<u8>, Self::Error>
All journal bytes accumulated since the last snapshot (empty is
normal).
Source§fn append_journal(&mut self, entry: &[u8]) -> Result<(), Self::Error>
fn append_journal(&mut self, entry: &[u8]) -> Result<(), Self::Error>
Appends one framed journal entry (see
crate::journal).impl StructuralPartialEq for MemStorage
Auto Trait Implementations§
impl Freeze for MemStorage
impl RefUnwindSafe for MemStorage
impl Send for MemStorage
impl Sync for MemStorage
impl Unpin for MemStorage
impl UnsafeUnpin for MemStorage
impl UnwindSafe for MemStorage
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