pub enum RetentionRule {
KeepFrameKind(FrameKind),
KeepScope(Scope),
KeepRecent {
min_sequence: u64,
},
DropWrittenBefore {
older_than_unix_ms: u64,
},
DropLastAccessedBefore {
older_than_unix_ms: u64,
},
DropOutsideScope {
required_scope: Option<Scope>,
},
KeepLabel(String),
DropLabel(String),
}Expand description
One deterministic retention rule.
Variants§
KeepFrameKind(FrameKind)
Keep candidates whose frame kind matches kind.
KeepScope(Scope)
Keep candidates whose normalized scope exactly matches this scope.
KeepRecent
Keep candidates at or above min_sequence, where larger sequence
values are newer.
DropWrittenBefore
Drop candidates whose write timestamp is older than older_than_unix_ms.
Fields
DropLastAccessedBefore
Drop candidates whose last-access timestamp is older than
older_than_unix_ms.
Fields
DropOutsideScope
Drop candidates whose normalized scope does not exactly match
required_scope. None requires an unscoped candidate.
KeepLabel(String)
Keep candidates with a host-defined retention label.
DropLabel(String)
Drop candidates with a host-defined retention label.
Implementations§
Source§impl RetentionRule
impl RetentionRule
Sourcepub fn evaluate(&self, candidate: RetentionCandidate<'_>) -> RetentionDecision
pub fn evaluate(&self, candidate: RetentionCandidate<'_>) -> RetentionDecision
Evaluate this rule against a single candidate.
Trait Implementations§
Source§impl Clone for RetentionRule
impl Clone for RetentionRule
Source§fn clone(&self) -> RetentionRule
fn clone(&self) -> RetentionRule
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 RetentionRule
impl Debug for RetentionRule
Source§impl PartialEq for RetentionRule
impl PartialEq for RetentionRule
Source§fn eq(&self, other: &RetentionRule) -> bool
fn eq(&self, other: &RetentionRule) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for RetentionRule
impl StructuralPartialEq for RetentionRule
Auto Trait Implementations§
impl Freeze for RetentionRule
impl RefUnwindSafe for RetentionRule
impl Send for RetentionRule
impl Sync for RetentionRule
impl Unpin for RetentionRule
impl UnsafeUnpin for RetentionRule
impl UnwindSafe for RetentionRule
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