pub struct MemoryStorage { /* private fields */ }Expand description
In-memory storage backend for tests and synthetic tools.
Implementations§
Source§impl MemoryStorage
impl MemoryStorage
Trait Implementations§
Source§impl Clone for MemoryStorage
impl Clone for MemoryStorage
Source§fn clone(&self) -> MemoryStorage
fn clone(&self) -> MemoryStorage
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 MemoryStorage
impl Debug for MemoryStorage
Source§impl Default for MemoryStorage
impl Default for MemoryStorage
Source§fn default() -> MemoryStorage
fn default() -> MemoryStorage
Returns the “default value” for a type. Read more
Source§impl WorldStorage for MemoryStorage
impl WorldStorage for MemoryStorage
Source§fn get_many(&self, keys: &[Bytes]) -> Result<Vec<Option<Bytes>>>
fn get_many(&self, keys: &[Bytes]) -> Result<Vec<Option<Bytes>>>
Looks up raw values by exact key, preserving input order.
Source§fn for_each_key(
&self,
options: StorageReadOptions,
visitor: &mut (dyn FnMut(&[u8]) -> Result<StorageVisitorControl> + Send),
) -> Result<StorageScanOutcome>
fn for_each_key( &self, options: StorageReadOptions, visitor: &mut (dyn FnMut(&[u8]) -> Result<StorageVisitorControl> + Send), ) -> Result<StorageScanOutcome>
Visits keys without forcing value materialization when the backend can
support key-only scans.
Source§fn for_each_prefix(
&self,
prefix: &[u8],
options: StorageReadOptions,
visitor: &mut (dyn FnMut(&[u8], &Bytes) -> Result<StorageVisitorControl> + Send),
) -> Result<StorageScanOutcome>
fn for_each_prefix( &self, prefix: &[u8], options: StorageReadOptions, visitor: &mut (dyn FnMut(&[u8], &Bytes) -> Result<StorageVisitorControl> + Send), ) -> Result<StorageScanOutcome>
Visits key/value records whose key starts with
prefix.Source§fn for_each_prefix_key(
&self,
prefix: &[u8],
options: StorageReadOptions,
visitor: &mut (dyn FnMut(&[u8]) -> Result<StorageVisitorControl> + Send),
) -> Result<StorageScanOutcome>
fn for_each_prefix_key( &self, prefix: &[u8], options: StorageReadOptions, visitor: &mut (dyn FnMut(&[u8]) -> Result<StorageVisitorControl> + Send), ) -> Result<StorageScanOutcome>
Visits keys whose key starts with
prefix without requiring value
materialization when the backend can support key-only scans.Source§fn write_batch(&self, batch: &StorageBatch) -> Result<()>
fn write_batch(&self, batch: &StorageBatch) -> Result<()>
Applies a batch of raw operations atomically when supported by the backend.
Source§fn flush(&self) -> Result<()>
fn flush(&self) -> Result<()>
Flushes pending writes to durable storage when supported by the backend.
Source§fn get_many_ordered_with_control(
&self,
keys: &[Bytes],
options: StorageReadOptions,
) -> Result<Vec<Option<Bytes>>>
fn get_many_ordered_with_control( &self, keys: &[Bytes], options: StorageReadOptions, ) -> Result<Vec<Option<Bytes>>>
Looks up raw values by exact key with read options and cancellation, preserving input order.
Source§fn for_each_prefix_ref(
&self,
prefix: &[u8],
options: StorageReadOptions,
visitor: &mut (dyn FnMut(StorageEntryRef<'_>) -> Result<StorageVisitorControl> + Send),
) -> Result<StorageScanOutcome>
fn for_each_prefix_ref( &self, prefix: &[u8], options: StorageReadOptions, visitor: &mut (dyn FnMut(StorageEntryRef<'_>) -> Result<StorageVisitorControl> + Send), ) -> Result<StorageScanOutcome>
Visits key/value records as borrowed byte views.
Source§fn for_each_entry(
&self,
options: StorageReadOptions,
visitor: &mut (dyn FnMut(&[u8], &Bytes) -> Result<StorageVisitorControl> + Send),
) -> Result<StorageScanOutcome>
fn for_each_entry( &self, options: StorageReadOptions, visitor: &mut (dyn FnMut(&[u8], &Bytes) -> Result<StorageVisitorControl> + Send), ) -> Result<StorageScanOutcome>
Visits all key/value records.
Auto Trait Implementations§
impl Freeze for MemoryStorage
impl RefUnwindSafe for MemoryStorage
impl Send for MemoryStorage
impl Sync for MemoryStorage
impl Unpin for MemoryStorage
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WorldStorageHandle for T
impl<T> WorldStorageHandle for T
Source§fn storage(&self) -> &dyn WorldStorage
fn storage(&self) -> &dyn WorldStorage
Returns the raw storage backend behind this handle.