pub struct ConfigBuilder {
pub color: bool,
pub duration: bool,
pub replace: bool,
}Expand description
Configure task_log using this interactive configuration struct.
This is done by calling methods an instance of the struct to configure it and then calling .apply() to apply that configuration. Behind the scenes this updates the static mutex holding the configuration.
§Example:
use task_log::ConfigBuilder;
ConfigBuilder::new()
.color(false)
.duration(false)
.apply()
.expect("Failed to configure logger");Fields§
§color: boolIf the prefix (e.g. “DONE” or “RUNNING”) should be in color.
duration: boolIf the duration that the task took should be included in the prefix (e.g. “DONE”) at the end of the task.
replace: boolIf the running output should be replaced with “DONE”
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
pub fn replace(self, replace: bool) -> Self
Sourcepub fn apply<'a>(self) -> Result<(), PoisonError<MutexGuard<'a, Self>>>
pub fn apply<'a>(self) -> Result<(), PoisonError<MutexGuard<'a, Self>>>
Apply the configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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