pub struct MemoryTxnManager { /* private fields */ }Expand description
A transaction manager backed by an in-memory map and optional WAL.
Implementations§
Source§impl MemoryTxnManager
impl MemoryTxnManager
Sourcepub fn new_with_limit(limit: Option<usize>) -> Self
pub fn new_with_limit(limit: Option<usize>) -> Self
Creates an in-memory manager with an optional memory limit.
Sourcepub fn memory_stats(&self) -> MemoryStats
pub fn memory_stats(&self) -> MemoryStats
Returns current memory usage statistics.
Sourcepub fn set_memory_limit(&self, limit: Option<usize>)
pub fn set_memory_limit(&self, limit: Option<usize>)
Update the configured memory limit at runtime.
Sourcepub fn compact_with_limit<F>(
&self,
input_bytes: usize,
output_bytes: usize,
run: F,
) -> Result<bool>
pub fn compact_with_limit<F>( &self, input_bytes: usize, output_bytes: usize, run: F, ) -> Result<bool>
Runs compaction if it can fit within the configured memory limit. Returns Ok(true) when compaction executed, Ok(false) when skipped.
Sourcepub fn compact_in_memory(&self) -> Result<bool>
pub fn compact_in_memory(&self) -> Result<bool>
In-memory compaction entrypoint that rebuilds the map while honoring memory limits.
Trait Implementations§
Source§impl<'a> TxnManager<'a, MemoryTransaction<'a>> for &'a MemoryTxnManager
impl<'a> TxnManager<'a, MemoryTransaction<'a>> for &'a MemoryTxnManager
Auto Trait Implementations§
impl Freeze for MemoryTxnManager
impl RefUnwindSafe for MemoryTxnManager
impl Send for MemoryTxnManager
impl Sync for MemoryTxnManager
impl Unpin for MemoryTxnManager
impl UnsafeUnpin for MemoryTxnManager
impl UnwindSafe for MemoryTxnManager
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