Struct rolling_file::RollingFileAppender [−][src]
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]
RC: RollingCondition,
pub fn new<P>(
path: P,
condition: RC,
max_files: usize
) -> Result<RollingFileAppender<RC>> where
P: AsRef<Path>,
[src]
path: P,
condition: RC,
max_files: usize
) -> Result<RollingFileAppender<RC>> where
P: AsRef<Path>,
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]
&mut self,
buf: &[u8],
now: &DateTime<Local>
) -> Result<usize>
Writes data using the given datetime to calculate the rolling condition
Trait Implementations
impl<RC: Debug> Debug for RollingFileAppender<RC> where
RC: RollingCondition,
[src]
RC: RollingCondition,
impl<RC> Write for RollingFileAppender<RC> where
RC: RollingCondition,
[src]
RC: RollingCondition,
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[src]
pub fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>
1.36.0[src]
pub fn is_write_vectored(&self) -> bool
[src]
pub fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
pub fn write_all_vectored(
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
[src]
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
pub fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>
1.0.0[src]
pub fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Auto Trait Implementations
impl<RC> RefUnwindSafe for RollingFileAppender<RC> where
RC: RefUnwindSafe,
RC: RefUnwindSafe,
impl<RC> Send for RollingFileAppender<RC> where
RC: Send,
RC: Send,
impl<RC> Sync for RollingFileAppender<RC> where
RC: Sync,
RC: Sync,
impl<RC> Unpin for RollingFileAppender<RC> where
RC: Unpin,
RC: Unpin,
impl<RC> UnwindSafe for RollingFileAppender<RC> where
RC: UnwindSafe,
RC: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,