pub struct ColdStore { /* private fields */ }Implementations§
Source§impl ColdStore
impl ColdStore
pub fn new(path: &str) -> Result<Self>
pub fn with_config( path: &str, cache_capacity_mb: usize, flush_interval_ms: Option<u64>, mode: ColdStoreMode, ) -> Result<Self>
pub fn get(&self, key: &str) -> Result<Option<Vec<u8>>>
Sourcepub fn set(&self, key: String, value: Vec<u8>) -> Result<()>
pub fn set(&self, key: String, value: Vec<u8>) -> Result<()>
Stores a value in cold storage.
Note: This operation does not automatically flush writes to disk.
Call flush() or compact() to ensure durability.
pub fn delete(&self, key: &str) -> Result<()>
pub fn scan(&self) -> impl Iterator<Item = Result<(String, Vec<u8>)>> + '_
pub fn scan_prefix( &self, prefix: &str, ) -> impl Iterator<Item = Result<(String, Vec<u8>)>> + '_
Sourcepub fn batch_set(&self, pairs: Vec<(String, Vec<u8>)>) -> Result<()>
pub fn batch_set(&self, pairs: Vec<(String, Vec<u8>)>) -> Result<()>
Batch operations for better performance.
Note: This operation does not automatically flush writes to disk.
Call flush() or compact() to ensure durability.
pub fn compact(&self) -> Result<()>
pub fn get_stats(&self) -> Result<ColdStoreStats>
pub fn estimated_size(&self) -> u64
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ColdStore
impl !RefUnwindSafe for ColdStore
impl Send for ColdStore
impl Sync for ColdStore
impl Unpin for ColdStore
impl !UnwindSafe for ColdStore
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