Struct BackupId
pub(super) struct BackupId {
pub(super) millis: u64,
pub(super) seq: u64,
}Expand description
Identifies a .corrupt-<millis>-<seq> backup file, ordered by creation
time.
millis (wall clock) is the real ordering signal: it stays correct
across a process restart, unlike seq, a per-process counter that resets
to 0 each run. seq only breaks ties between backups created in the same
millisecond – it is not derived from which names already exist, since
pruning can free up a small seq and let a later backup reuse it,
making it sort as older than it really is. Deriving Ord from the
field order (millis first, then seq) gives exactly that priority.
Fields§
§millis: u64§seq: u64Implementations§
§impl BackupId
impl BackupId
fn generate() -> Self
fn generate() -> Self
Allocates a fresh id from the wall clock and a per-process counter.
pub(super) fn parse(suffix: &str) -> Option<Self>
pub(super) fn parse(suffix: &str) -> Option<Self>
Parses the <millis>-<seq> suffix produced by
Display.
fn backup_path_for(self, original: &Path) -> PathBuf
fn backup_path_for(self, original: &Path) -> PathBuf
Backup path for original: its file name with a .corrupt-<id>
suffix.
Trait Implementations§
§impl Ord for BackupId
impl Ord for BackupId
§impl PartialOrd for BackupId
impl PartialOrd for BackupId
impl Copy for BackupId
impl Eq for BackupId
impl StructuralPartialEq for BackupId
Auto Trait Implementations§
impl Freeze for BackupId
impl RefUnwindSafe for BackupId
impl Send for BackupId
impl Sync for BackupId
impl Unpin for BackupId
impl UnwindSafe for BackupId
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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