Struct rolling_file::RollingFileAppender[][src]

pub struct RollingFileAppender<RC> where
    RC: RollingCondition
{ /* fields omitted */ }

Writes data to a file, and “rolls over” to preserve older data in a separate set of files. Old files have a Debian-style naming scheme where we have base_filename, base_filename.1, …, base_filename.N where N is the maximum number of rollover files to keep.

Implementations

impl<RC> RollingFileAppender<RC> where
    RC: RollingCondition
[src]

pub fn new<P>(
    path: P,
    condition: RC,
    max_files: usize
) -> Result<RollingFileAppender<RC>> where
    P: AsRef<Path>, 
[src]

Creates a new rolling file appender with the given condition. The parent directory of the base path must already exist.

pub fn rollover(&mut self) -> Result<()>[src]

Forces a rollover to happen immediately.

pub fn write_with_datetime(
    &mut self,
    buf: &[u8],
    now: &DateTime<Local>
) -> Result<usize>
[src]

Writes data using the given datetime to calculate the rolling condition

Trait Implementations

impl<RC: Debug> Debug for RollingFileAppender<RC> where
    RC: RollingCondition
[src]

impl<RC> Write for RollingFileAppender<RC> where
    RC: RollingCondition
[src]

Auto Trait Implementations

impl<RC> RefUnwindSafe for RollingFileAppender<RC> where
    RC: RefUnwindSafe

impl<RC> Send for RollingFileAppender<RC> where
    RC: Send

impl<RC> Sync for RollingFileAppender<RC> where
    RC: Sync

impl<RC> Unpin for RollingFileAppender<RC> where
    RC: Unpin

impl<RC> UnwindSafe for RollingFileAppender<RC> where
    RC: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.