pub struct ColdStore { /* private fields */ }Implementations§
Source§impl ColdStore
impl ColdStore
Sourcepub fn with_config(
path: &str,
cache_capacity_mb: usize,
flush_interval_ms: Option<u64>,
mode: ColdStoreMode,
) -> Result<Self>
pub fn with_config( path: &str, cache_capacity_mb: usize, flush_interval_ms: Option<u64>, mode: ColdStoreMode, ) -> Result<Self>
Creates a new ColdStore instance with custom configuration
Sourcepub fn scan(&self) -> impl Iterator<Item = Result<(String, Vec<u8>)>> + '_
pub fn scan(&self) -> impl Iterator<Item = Result<(String, Vec<u8>)>> + '_
Returns an iterator over all key-value pairs
Sourcepub fn scan_prefix(
&self,
prefix: &str,
) -> impl Iterator<Item = Result<(String, Vec<u8>)>> + '_
pub fn scan_prefix( &self, prefix: &str, ) -> impl Iterator<Item = Result<(String, Vec<u8>)>> + '_
Returns an iterator over keys with a specific prefix
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
Sourcepub fn get_stats(&self) -> Result<ColdStoreStats>
pub fn get_stats(&self) -> Result<ColdStoreStats>
Get database statistics
Sourcepub fn estimated_size(&self) -> u64
pub fn estimated_size(&self) -> u64
Get estimated size on disk
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