Skip to main content

SnapshotLike

Trait SnapshotLike 

Source
pub trait SnapshotLike {
    // Required methods
    fn end_time(&self) -> DateTime<Utc>;
    fn id(&self) -> &str;

    // Provided method
    fn pinned(&self) -> bool { ... }
}
Expand description

Anything that can stand in for a Snapshot during retention selection. Kept tiny so tests use trivial fakes instead of constructing full Snapshot CRs.

Required Methods§

Source

fn end_time(&self) -> DateTime<Utc>

The snapshot’s completion time — the GFS bucketing key (ADR §4.4 step 2).

Source

fn id(&self) -> &str

A stable identifier (kopia snapshot ID or CR name) used in the result sets.

Provided Methods§

Source

fn pinned(&self) -> bool

Whether this snapshot is pinned (Snapshot.spec.pin, ADR-0005 §13(c)). A pinned snapshot is exempt from GFS retention: select_kept never places it in delete, regardless of the policy. Defaults false so existing impls (and discovered snapshots) keep their behavior.

Implementors§