pub struct LegacyStorageSnapshotManager { /* private fields */ }Expand description
Legacy snapshot manager (kept for backwards compatibility).
Manages point-in-time storage snapshots with TTL, lifecycle states, auto-cleanup, and diff computation.
Implementations§
Source§impl LegacyStorageSnapshotManager
impl LegacyStorageSnapshotManager
Sourcepub fn new(config: SnapshotConfig) -> Self
pub fn new(config: SnapshotConfig) -> Self
Create a new manager with the given configuration.
Sourcepub fn create_snapshot(
&mut self,
label: &str,
block_cids: Vec<String>,
total_bytes: u64,
) -> Result<u64, String>
pub fn create_snapshot( &mut self, label: &str, block_cids: Vec<String>, total_bytes: u64, ) -> Result<u64, String>
Create a snapshot with the given label and block data.
Returns the assigned snapshot id on success. Returns an error if the maximum number of active (non-deleted) snapshots has been reached.
Sourcepub fn get_snapshot(&self, id: u64) -> Option<&StorageSnapshot>
pub fn get_snapshot(&self, id: u64) -> Option<&StorageSnapshot>
Look up a snapshot by id.
Sourcepub fn restore_snapshot(&self, id: u64) -> Result<Vec<String>, String>
pub fn restore_snapshot(&self, id: u64) -> Result<Vec<String>, String>
Restore a snapshot, returning a clone of its block CIDs.
Sourcepub fn list_snapshots(&self) -> Vec<(u64, String, SnapshotState)>
pub fn list_snapshots(&self) -> Vec<(u64, String, SnapshotState)>
List all snapshots as (id, label, state) tuples.
Sourcepub fn tick_cleanup(&mut self)
pub fn tick_cleanup(&mut self)
Advance the internal tick, expire TTL-exceeded snapshots, and optionally
remove Deleted snapshots if auto_cleanup is enabled.
Sourcepub fn ready_count(&self) -> usize
pub fn ready_count(&self) -> usize
Count snapshots currently in Ready state.
Sourcepub fn diff_snapshots(
&self,
id_a: u64,
id_b: u64,
) -> Result<LegacySnapshotDiff, String>
pub fn diff_snapshots( &self, id_a: u64, id_b: u64, ) -> Result<LegacySnapshotDiff, String>
Compute the diff between two snapshots identified by their ids.
Sourcepub fn stats(&self) -> SnapshotManagerStats
pub fn stats(&self) -> SnapshotManagerStats
Return aggregate statistics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LegacyStorageSnapshotManager
impl RefUnwindSafe for LegacyStorageSnapshotManager
impl Send for LegacyStorageSnapshotManager
impl Sync for LegacyStorageSnapshotManager
impl Unpin for LegacyStorageSnapshotManager
impl UnsafeUnpin for LegacyStorageSnapshotManager
impl UnwindSafe for LegacyStorageSnapshotManager
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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