pub struct DataStore { /* private fields */ }Expand description
DataStore
Thin persistence wrapper over one stable BTreeMap.
Invariant: callers provide already-validated RawDataKey and canonical row bytes.
This type intentionally does not enforce commit-phase ordering.
Implementations§
Source§impl DataStore
impl DataStore
Sourcepub fn init(memory: VirtualMemory<DefaultMemoryImpl>) -> Self
pub fn init(memory: VirtualMemory<DefaultMemoryImpl>) -> Self
Initialize a data store with the provided backing memory.
Sourcepub fn contains(&self, key: &RawDataKey) -> bool
pub fn contains(&self, key: &RawDataKey) -> bool
Return whether one raw key exists without cloning the row payload.
Sourcepub fn memory_bytes(&self) -> u64
pub fn memory_bytes(&self) -> u64
Sum of bytes used by all stored rows.
Auto Trait Implementations§
impl !Freeze for DataStore
impl !RefUnwindSafe for DataStore
impl !Send for DataStore
impl !Sync for DataStore
impl Unpin for DataStore
impl UnsafeUnpin for DataStore
impl !UnwindSafe for DataStore
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