pub enum NamedRootRetention {
All,
Exact {
names: Vec<Vec<u8>>,
},
Prefix {
prefix: Vec<u8>,
},
NewestByName {
prefix: Vec<u8>,
count: usize,
},
UpdatedSince {
prefix: Vec<u8>,
min_updated_at_millis: u64,
},
}Expand description
Policy for selecting named roots to retain during garbage collection.
NewestByName keeps the lexicographically greatest names matching prefix.
This works well for names that include sortable sequence numbers or
timestamps, for example checkpoint/000042 or
checkpoint/2026-07-01T12:00:00Z.
Variants§
All
Retain every named root in the manifest store.
Exact
Retain an explicit list of root names.
Prefix
Retain every named root whose name starts with prefix.
NewestByName
Retain the lexicographically newest count roots with a prefix.
UpdatedSince
Retain roots with updated_at_millis >= min_updated_at_millis.
Implementations§
Source§impl NamedRootRetention
impl NamedRootRetention
Sourcepub fn prefix(prefix: impl AsRef<[u8]>) -> Self
pub fn prefix(prefix: impl AsRef<[u8]>) -> Self
Retain every named root whose name starts with prefix.
Sourcepub fn newest_by_name(prefix: impl AsRef<[u8]>, count: usize) -> Self
pub fn newest_by_name(prefix: impl AsRef<[u8]>, count: usize) -> Self
Retain the lexicographically newest count roots with prefix.
Sourcepub fn updated_since(
prefix: impl AsRef<[u8]>,
min_updated_at_millis: u64,
) -> Self
pub fn updated_since( prefix: impl AsRef<[u8]>, min_updated_at_millis: u64, ) -> Self
Retain roots updated at or after min_updated_at_millis.
Sourcepub fn updated_within(
prefix: impl AsRef<[u8]>,
now_millis: u64,
max_age: Duration,
) -> Self
pub fn updated_within( prefix: impl AsRef<[u8]>, now_millis: u64, max_age: Duration, ) -> Self
Retain roots updated within max_age before now_millis.
now_millis is explicit so tests, replay, and distributed systems can
choose their own clock source. The cutoff saturates at zero when
max_age is larger than now_millis.
Sourcepub fn updated_within_millis(
prefix: impl AsRef<[u8]>,
now_millis: u64,
window_millis: u64,
) -> Self
pub fn updated_within_millis( prefix: impl AsRef<[u8]>, now_millis: u64, window_millis: u64, ) -> Self
Retain roots updated within window_millis before now_millis.
Sourcepub fn updated_within_days(
prefix: impl AsRef<[u8]>,
now_millis: u64,
days: u64,
) -> Self
pub fn updated_within_days( prefix: impl AsRef<[u8]>, now_millis: u64, days: u64, ) -> Self
Retain roots updated within days calendar-day windows before now_millis.
This is a convenience wrapper for retention rules such as “keep roots updated in the last 7 days”. A day is treated as exactly 86,400,000 milliseconds.
Trait Implementations§
Source§impl Clone for NamedRootRetention
impl Clone for NamedRootRetention
Source§fn clone(&self) -> NamedRootRetention
fn clone(&self) -> NamedRootRetention
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NamedRootRetention
impl Debug for NamedRootRetention
Source§impl PartialEq for NamedRootRetention
impl PartialEq for NamedRootRetention
impl StructuralPartialEq for NamedRootRetention
Auto Trait Implementations§
impl Freeze for NamedRootRetention
impl RefUnwindSafe for NamedRootRetention
impl Send for NamedRootRetention
impl Sync for NamedRootRetention
impl Unpin for NamedRootRetention
impl UnsafeUnpin for NamedRootRetention
impl UnwindSafe for NamedRootRetention
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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