pub struct RotationConfig {
pub strategy: RotationStrategy,
pub max_files: Option<u32>,
pub compress: bool,
}Expand description
Log rotation configuration.
Fields§
§strategy: RotationStrategyRotation strategy.
max_files: Option<u32>Maximum number of rotated files to keep. None means keep all files indefinitely.
compress: boolWhether to compress rotated files (future feature).
Implementations§
Source§impl RotationConfig
impl RotationConfig
Sourcepub fn new(strategy: RotationStrategy) -> RotationConfig
pub fn new(strategy: RotationStrategy) -> RotationConfig
Create a new rotation config with the given strategy.
Sourcepub fn daily() -> RotationConfig
pub fn daily() -> RotationConfig
Create a daily rotation config.
Sourcepub fn hourly() -> RotationConfig
pub fn hourly() -> RotationConfig
Create an hourly rotation config.
Sourcepub fn minutely() -> RotationConfig
pub fn minutely() -> RotationConfig
Create a minutely rotation config (for testing).
Sourcepub fn never() -> RotationConfig
pub fn never() -> RotationConfig
Create a never-rotate config.
Sourcepub fn with_max_files(self, max: u32) -> RotationConfig
pub fn with_max_files(self, max: u32) -> RotationConfig
Set the maximum number of rotated files to keep.
Sourcepub fn keep_all(self) -> RotationConfig
pub fn keep_all(self) -> RotationConfig
Keep all rotated files indefinitely.
Sourcepub fn with_compression(self, compress: bool) -> RotationConfig
pub fn with_compression(self, compress: bool) -> RotationConfig
Enable compression of rotated files (future feature).
Trait Implementations§
Source§impl Clone for RotationConfig
impl Clone for RotationConfig
Source§fn clone(&self) -> RotationConfig
fn clone(&self) -> RotationConfig
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 RotationConfig
impl Debug for RotationConfig
Source§impl Default for RotationConfig
impl Default for RotationConfig
Source§fn default() -> RotationConfig
fn default() -> RotationConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RotationConfig
impl<'de> Deserialize<'de> for RotationConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RotationConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RotationConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RotationConfig
impl PartialEq for RotationConfig
Source§impl Serialize for RotationConfig
impl Serialize for RotationConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for RotationConfig
impl StructuralPartialEq for RotationConfig
Auto Trait Implementations§
impl Freeze for RotationConfig
impl RefUnwindSafe for RotationConfig
impl Send for RotationConfig
impl Sync for RotationConfig
impl Unpin for RotationConfig
impl UnsafeUnpin for RotationConfig
impl UnwindSafe for RotationConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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