pub struct DiskSnapshotStore { /* private fields */ }Expand description
Disk-backed implementation of SnapshotStore.
Wraps a SnapshotManager to provide a trait-based interface with
atomic writes (write-to-temp + fsync + rename) for crash safety.
Implementations§
Source§impl DiskSnapshotStore
impl DiskSnapshotStore
Sourcepub fn new(config: SnapshotConfig) -> RaftResult<Self>
pub fn new(config: SnapshotConfig) -> RaftResult<Self>
Create a new disk-backed snapshot store.
Sourcepub fn manager(&self) -> &SnapshotManager
pub fn manager(&self) -> &SnapshotManager
Access the underlying snapshot manager.
Sourcepub fn manager_mut(&mut self) -> &mut SnapshotManager
pub fn manager_mut(&mut self) -> &mut SnapshotManager
Mutably access the underlying snapshot manager.
Trait Implementations§
Source§impl SnapshotStore for DiskSnapshotStore
impl SnapshotStore for DiskSnapshotStore
Source§fn save(
&mut self,
data: Vec<u8>,
last_included_index: LogIndex,
last_included_term: Term,
) -> RaftResult<SnapshotMetadata>
fn save( &mut self, data: Vec<u8>, last_included_index: LogIndex, last_included_term: Term, ) -> RaftResult<SnapshotMetadata>
Save a snapshot to storage and return the generated metadata.
Source§fn load_latest(&self) -> RaftResult<Option<Snapshot>>
fn load_latest(&self) -> RaftResult<Option<Snapshot>>
Load the most recent snapshot from storage.
Source§fn list(&self) -> RaftResult<Vec<SnapshotMetadata>>
fn list(&self) -> RaftResult<Vec<SnapshotMetadata>>
List metadata for all stored snapshots.
Auto Trait Implementations§
impl Freeze for DiskSnapshotStore
impl RefUnwindSafe for DiskSnapshotStore
impl Send for DiskSnapshotStore
impl Sync for DiskSnapshotStore
impl Unpin for DiskSnapshotStore
impl UnsafeUnpin for DiskSnapshotStore
impl UnwindSafe for DiskSnapshotStore
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