pub enum SnapshotCreateOutcome {
Created(Box<SnapshotCreateResult>),
Unchanged,
}Expand description
What a kopia snapshot create actually did.
Two outcomes, both successes, and they are NOT interchangeable:
Created— a new manifest exists and this run owns it.Unchanged— kopia declined to write one because the source is byte-identical to the previous snapshot (its retention knobignoreIdenticalSnapshots). There is no new manifest, and crucially nothing this run may claim: the newest manifest for this identity belongs to the previousSnapshotCR, which owns it via a finalizer and will delete it when retention prunes that CR.
Modelled as an enum rather than Option<SnapshotCreateResult> so the
distinction cannot be unwrap_or_default-ed away. Collapsing it is exactly
the bug: a deduped run recorded as an ordinary success goes looking for
“its” snapshot, finds its predecessor’s, and two CRs end up claiming one
manifest (#351).
Variants§
Created(Box<SnapshotCreateResult>)
kopia wrote a new manifest; this run owns it.
Boxed so the enum stays small: SnapshotCreateResult is ~320 bytes and
Unchanged is zero-sized, and every caller moves the result out
immediately.
Unchanged
kopia deduped: nothing changed, so no manifest was written and this run owns nothing. The previous snapshot remains the live restore point.
Trait Implementations§
Source§impl Clone for SnapshotCreateOutcome
impl Clone for SnapshotCreateOutcome
Source§fn clone(&self) -> SnapshotCreateOutcome
fn clone(&self) -> SnapshotCreateOutcome
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SnapshotCreateOutcome
impl Debug for SnapshotCreateOutcome
impl Eq for SnapshotCreateOutcome
Source§impl PartialEq for SnapshotCreateOutcome
impl PartialEq for SnapshotCreateOutcome
Source§fn eq(&self, other: &SnapshotCreateOutcome) -> bool
fn eq(&self, other: &SnapshotCreateOutcome) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SnapshotCreateOutcome
Auto Trait Implementations§
impl Freeze for SnapshotCreateOutcome
impl RefUnwindSafe for SnapshotCreateOutcome
impl Send for SnapshotCreateOutcome
impl Sync for SnapshotCreateOutcome
impl Unpin for SnapshotCreateOutcome
impl UnsafeUnpin for SnapshotCreateOutcome
impl UnwindSafe for SnapshotCreateOutcome
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