pub struct IncrementalStorage { /* private fields */ }Expand description
Incremental storage manager with WAL and checkpointing
Provides efficient incremental persistence with fast recovery.
Implementations§
Source§impl IncrementalStorage
impl IncrementalStorage
Sourcepub fn new<P: AsRef<Path>>(
base_path: P,
config: IncrementalConfig,
) -> Result<Self>
pub fn new<P: AsRef<Path>>( base_path: P, config: IncrementalConfig, ) -> Result<Self>
Create or open incremental storage
Sourcepub fn log_remove(&mut self, id: &str) -> Result<()>
pub fn log_remove(&mut self, id: &str) -> Result<()>
Log a remove operation to WAL
Sourcepub fn needs_checkpoint(&self) -> bool
pub fn needs_checkpoint(&self) -> bool
Check if checkpoint is needed
Sourcepub fn checkpoint<T: Serialize>(
&mut self,
index: &T,
meta: IndexMetadata,
) -> Result<CheckpointMeta>
pub fn checkpoint<T: Serialize>( &mut self, index: &T, meta: IndexMetadata, ) -> Result<CheckpointMeta>
Create a checkpoint from serializable index data
Sourcepub fn load_checkpoint<T: for<'de> Deserialize<'de>>(
&self,
) -> Result<Option<(T, CheckpointMeta)>>
pub fn load_checkpoint<T: for<'de> Deserialize<'de>>( &self, ) -> Result<Option<(T, CheckpointMeta)>>
Load checkpoint and return deserialized data
Sourcepub fn get_wal_entries(&self) -> Result<Vec<WalEntry>>
pub fn get_wal_entries(&self) -> Result<Vec<WalEntry>>
Get WAL entries since last checkpoint
Sourcepub fn stats(&self) -> StorageStats
pub fn stats(&self) -> StorageStats
Get storage statistics
Auto Trait Implementations§
impl Freeze for IncrementalStorage
impl RefUnwindSafe for IncrementalStorage
impl Send for IncrementalStorage
impl Sync for IncrementalStorage
impl Unpin for IncrementalStorage
impl UnsafeUnpin for IncrementalStorage
impl UnwindSafe for IncrementalStorage
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more