pub struct RotatingFile { /* private fields */ }Expand description
Struct masquerades as a file handle and is written to by whatever you like
Implementations§
Source§impl RotatingFile
impl RotatingFile
Sourcepub fn new(
path_str: &str,
rotation_method: RotationCondition,
prune_method: PruneCondition,
require_newline: bool,
) -> Result<Self>
pub fn new( path_str: &str, rotation_method: RotationCondition, prune_method: PruneCondition, require_newline: bool, ) -> Result<Self>
Create a new RotatingFile given a desired filename and rotation option. The filename represents the stem or root of the files to be generated.
Sourcepub fn index(&self) -> u32
pub fn index(&self) -> u32
A read-only wrapper to the index, at the moment only for testing purposes.
pub fn current_file(&self) -> &File
pub fn current_file_path_str(&self) -> &str
pub fn current_file_name_str(&self) -> &str
Trait Implementations§
Source§impl Debug for RotatingFile
impl Debug for RotatingFile
Source§impl Write for RotatingFile
impl Write for RotatingFile
Source§fn write(&mut self, bytes: &[u8]) -> Result<usize, Error>
fn write(&mut self, bytes: &[u8]) -> Result<usize, Error>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl Freeze for RotatingFile
impl RefUnwindSafe for RotatingFile
impl Send for RotatingFile
impl Sync for RotatingFile
impl Unpin for RotatingFile
impl UnwindSafe for RotatingFile
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