pub struct StorageEngine { /* private fields */ }Expand description
Storage engine manager
Provides a persistent key-value storage using LSM-tree architecture.
Implementations§
Source§impl StorageEngine
impl StorageEngine
Sourcepub fn open(path: impl AsRef<Path>) -> Result<StorageEngine, Error>
pub fn open(path: impl AsRef<Path>) -> Result<StorageEngine, Error>
Open or create a storage engine at the given path
Sourcepub fn open_with_config(
path: impl AsRef<Path>,
config: StorageConfig,
) -> Result<StorageEngine, Error>
pub fn open_with_config( path: impl AsRef<Path>, config: StorageConfig, ) -> Result<StorageEngine, Error>
Open or create a storage engine with custom configuration
Sourcepub fn put(&self, key: &[u8], value: &[u8]) -> Result<(), Error>
pub fn put(&self, key: &[u8], value: &[u8]) -> Result<(), Error>
Insert or update a key-value pair
Sourcepub fn stats(&self) -> StorageStats
pub fn stats(&self) -> StorageStats
Get storage statistics
Auto Trait Implementations§
impl Freeze for StorageEngine
impl RefUnwindSafe for StorageEngine
impl Send for StorageEngine
impl Sync for StorageEngine
impl Unpin for StorageEngine
impl UnwindSafe for StorageEngine
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