pub struct RetentionPolicy {
pub rules: Vec<RetentionRule>,
}Expand description
A comma separated list of retention rules ordered by duration, with the first rule being the shortest
eg. 4h:1h,1W:U,4W:1D,6M:1W,1Y:1M,U:6M
Fields§
§rules: Vec<RetentionRule>Implementations§
Source§impl RetentionPolicy
impl RetentionPolicy
pub fn new(rules: Vec<RetentionRule>) -> Self
Sourcepub fn is_ready_with_time(
&self,
new_time: &DateTime<Utc>,
last_time: &DateTime<Utc>,
) -> bool
pub fn is_ready_with_time( &self, new_time: &DateTime<Utc>, last_time: &DateTime<Utc>, ) -> bool
Returns true if the policy is ready to be applied based on a given time
Trait Implementations§
Source§impl Clone for RetentionPolicy
impl Clone for RetentionPolicy
Source§fn clone(&self) -> RetentionPolicy
fn clone(&self) -> RetentionPolicy
Returns a duplicate of the value. Read more
1.0.0 · 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 RetentionPolicy
impl Debug for RetentionPolicy
Source§impl Default for RetentionPolicy
impl Default for RetentionPolicy
Source§impl Display for RetentionPolicy
impl Display for RetentionPolicy
Source§impl FromStr for RetentionPolicy
impl FromStr for RetentionPolicy
Source§impl PartialEq for RetentionPolicy
impl PartialEq for RetentionPolicy
impl Eq for RetentionPolicy
impl StructuralPartialEq for RetentionPolicy
Auto Trait Implementations§
impl Freeze for RetentionPolicy
impl RefUnwindSafe for RetentionPolicy
impl Send for RetentionPolicy
impl Sync for RetentionPolicy
impl Unpin for RetentionPolicy
impl UnwindSafe for RetentionPolicy
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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