pub struct MemoryKV { /* private fields */ }Expand description
An in-memory key-value store.
Implementations§
Source§impl MemoryKV
impl MemoryKV
Sourcepub fn memory_stats(&self) -> MemoryStats
pub fn memory_stats(&self) -> MemoryStats
Returns current in-memory usage statistics.
Sourcepub fn new_with_limit(limit: Option<usize>) -> Self
pub fn new_with_limit(limit: Option<usize>) -> Self
Creates a new in-memory KV store with an optional memory limit.
Trait Implementations§
Source§impl KVStore for MemoryKV
impl KVStore for MemoryKV
Source§type Transaction<'a> = MemoryTransaction<'a>
type Transaction<'a> = MemoryTransaction<'a>
The transaction type for this store.
Source§type Manager<'a> = &'a MemoryTxnManager
type Manager<'a> = &'a MemoryTxnManager
The transaction manager for this store.
Source§fn txn_manager(&self) -> Self::Manager<'_>
fn txn_manager(&self) -> Self::Manager<'_>
Returns the transaction manager for this store.
Source§fn begin(&self, mode: TxnMode) -> Result<Self::Transaction<'_>>
fn begin(&self, mode: TxnMode) -> Result<Self::Transaction<'_>>
A convenience method to begin a new transaction.
Source§fn runtime_stats(&self) -> Option<RuntimeStats>
fn runtime_stats(&self) -> Option<RuntimeStats>
Returns a point-in-time runtime statistics snapshot, when supported.
Source§fn set_memory_limit_bytes(&self, limit: Option<usize>) -> Result<()>
fn set_memory_limit_bytes(&self, limit: Option<usize>) -> Result<()>
Sets the memory limit in bytes, when supported.
Source§fn read_at_capability(&self) -> ReadAtCapability
fn read_at_capability(&self) -> ReadAtCapability
Reports whether this backend can open a retained snapshot at a
caller-provided cluster data epoch. Read more
Source§fn begin_read_at(
&self,
point: &ReadAtPoint,
) -> ReadAtResult<Self::Transaction<'_>>
fn begin_read_at( &self, point: &ReadAtPoint, ) -> ReadAtResult<Self::Transaction<'_>>
Opens a read-only snapshot at a previously fenced cluster read point. Read more
Source§fn set_cache_capacity_bytes(&self, _capacity: usize) -> Result<()>
fn set_cache_capacity_bytes(&self, _capacity: usize) -> Result<()>
Sets the cache capacity in bytes, when supported.
Source§fn clear_cache(&self) -> Result<usize>
fn clear_cache(&self) -> Result<usize>
Clears the cache and returns the number of bytes removed.
Source§impl OwnedKVStore for MemoryKV
impl OwnedKVStore for MemoryKV
Source§fn begin_owned_kv_transaction(
self: Arc<Self>,
mode: TxnMode,
) -> Result<Box<dyn OwnedKVTransaction>>
fn begin_owned_kv_transaction( self: Arc<Self>, mode: TxnMode, ) -> Result<Box<dyn OwnedKVTransaction>>
Begin a transaction whose lifetime is independent of the
Arc<Self> call site.Auto Trait Implementations§
impl Freeze for MemoryKV
impl RefUnwindSafe for MemoryKV
impl Send for MemoryKV
impl Sync for MemoryKV
impl Unpin for MemoryKV
impl UnsafeUnpin for MemoryKV
impl UnwindSafe for MemoryKV
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> OwnedSessionFactory for Twhere
T: OwnedKVStore,
impl<T> OwnedSessionFactory for Twhere
T: OwnedKVStore,
Source§fn begin_owned_read(
self: Arc<Self>,
_options: OwnedReadOptions,
) -> Result<OwnedReadSession>
fn begin_owned_read( self: Arc<Self>, _options: OwnedReadOptions, ) -> Result<OwnedReadSession>
Begin an owned read-only session.
Source§fn begin_owned_transaction(
self: Arc<Self>,
mode: TxnMode,
) -> Result<OwnedTransactionSession>
fn begin_owned_transaction( self: Arc<Self>, mode: TxnMode, ) -> Result<OwnedTransactionSession>
Begin an owned transaction session.