pub struct FileSink { /* private fields */ }Expand description
Implementations
sourceimpl FileSink
impl FileSink
sourcepub fn new<P>(path: P, truncate: bool) -> Result<FileSink> where
P: AsRef<Path>,
pub fn new<P>(path: P, truncate: bool) -> Result<FileSink> where
P: AsRef<Path>,
Constructs a FileSink.
If the parameter truncate is true, the existing contents of the file
will be discarded.
Errors
If an error occurs opening the file, Error::CreateDirectory or
Error::OpenFile will be returned.
Trait Implementations
sourceimpl Sink for FileSink
impl Sink for FileSink
sourcefn level_filter(&self) -> LevelFilter
fn level_filter(&self) -> LevelFilter
Gets the log level filter.
sourcefn set_level_filter(&self, level_filter: LevelFilter)
fn set_level_filter(&self, level_filter: LevelFilter)
Sets the log level filter.
sourcefn swap_formatter(&self, formatter: Box<dyn Formatter>) -> Box<dyn Formatter>
fn swap_formatter(&self, formatter: Box<dyn Formatter>) -> Box<dyn Formatter>
Sets the log level filter, and returns the old formatter.
sourcefn should_log(&self, level: Level) -> bool
fn should_log(&self, level: Level) -> bool
Determines if a log message with the specified level would be logged.
sourcefn set_formatter(&self, formatter: Box<dyn Formatter>)
fn set_formatter(&self, formatter: Box<dyn Formatter>)
Sets the formatter.
Auto Trait Implementations
impl !RefUnwindSafe for FileSink
impl Send for FileSink
impl Sync for FileSink
impl Unpin for FileSink
impl !UnwindSafe for FileSink
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more