pub struct MemoryStorage { /* private fields */ }Expand description
In-memory storage backend.
Stores data in a HashMap without any persistence. Useful for testing and scenarios where persistence is not required.
Implementations§
Source§impl MemoryStorage
impl MemoryStorage
Trait Implementations§
Source§impl Default for MemoryStorage
impl Default for MemoryStorage
Source§impl Storage for MemoryStorage
impl Storage for MemoryStorage
fn save(&mut self, key: &str, data: Vec<u8>) -> Result<()>
fn load(&self, key: &str) -> Result<Option<Vec<u8>>>
fn delete(&mut self, key: &str) -> Result<()>
fn list_keys(&self) -> Result<Vec<String>>
Source§fn begin_transaction(&mut self) -> Result<()>
fn begin_transaction(&mut self) -> Result<()>
Begins a transaction. All subsequent save/delete operations are buffered
until commit_transaction() is called. Read more
Auto Trait Implementations§
impl Freeze for MemoryStorage
impl RefUnwindSafe for MemoryStorage
impl Send for MemoryStorage
impl Sync for MemoryStorage
impl Unpin for MemoryStorage
impl UnwindSafe for MemoryStorage
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