pub struct RetentionPolicy {
pub generations: Option<u32>,
pub roll_interval: Option<Duration>,
}Expand description
Composable retention policy for FileLog’s rotated backups (NEW-157). Both fields are
independently optional and may be set together (e.g. “roll daily, keep the last 30 dated
files”).
Fields§
§generations: Option<u32>Keep at most this many rotated backups, pruning the oldest once exceeded. Some(0) is
rejected at FileLog::open_with_options time (indistinguishable from “no policy”, so
treated as a config error rather than silently behaving like None).
roll_interval: Option<Duration>Roll onto a new dated backup once this much wall-clock time has elapsed since the active
file’s current interval began, in addition to (not instead of) the existing
MaxFileLogSize size trigger. A raw Duration (rather than a fixed Daily/Hourly
enum) so operators can pick any interval; Some(Duration::ZERO) is rejected as invalid.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RetentionPolicy
Source§impl Debug for RetentionPolicy
impl Debug for RetentionPolicy
Source§impl Default for RetentionPolicy
impl Default for RetentionPolicy
Source§fn default() -> RetentionPolicy
fn default() -> RetentionPolicy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RetentionPolicy
impl RefUnwindSafe for RetentionPolicy
impl Send for RetentionPolicy
impl Sync for RetentionPolicy
impl Unpin for RetentionPolicy
impl UnsafeUnpin 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