Enum termprogress::silent::MaybeSilent
source · pub enum MaybeSilent<T> {
Silent,
Loud(T),
}
Expand description
An enum wrapper for a progress bar or spinner that might be silent.
Variants§
Implementations§
source§impl<T> MaybeSilent<T>
impl<T> MaybeSilent<T>
sourcepub fn new<U>(from: U) -> Selfwhere
U: Into<Option<T>>,
pub fn new<U>(from: U) -> Selfwhere U: Into<Option<T>>,
Create a new MaybeSilent
with a potential value
sourcepub fn as_mut(&mut self) -> Option<&mut T>
pub fn as_mut(&mut self) -> Option<&mut T>
Get a mutable reference to the inner type if possible
sourcepub fn as_display_mut(&mut self) -> Option<&mut (dyn Display + 'static)>where
T: Display + 'static,
pub fn as_display_mut(&mut self) -> Option<&mut (dyn Display + 'static)>where T: Display + 'static,
Get a dynamic mutable reference to the internal value if it is Display
.
sourcepub fn into_inner(self) -> Option<T>
pub fn into_inner(self) -> Option<T>
Consume this instance and return the inner value if possible
sourcepub fn into_silent(self) -> Option<Silent>
pub fn into_silent(self) -> Option<Silent>
Consume this instance and return silent if it had no value
sourcepub fn as_bar_mut(&mut self) -> Option<&mut (dyn ProgressBar + 'static)>where
T: ProgressBar + 'static,
pub fn as_bar_mut(&mut self) -> Option<&mut (dyn ProgressBar + 'static)>where T: ProgressBar + 'static,
Get a dynamic mutable reference to the internal value if it is ProgressBar
sourcepub fn as_spinner_mut(&mut self) -> Option<&mut (dyn Spinner + 'static)>where
T: Spinner + 'static,
pub fn as_spinner_mut(&mut self) -> Option<&mut (dyn Spinner + 'static)>where T: Spinner + 'static,
Get a dynamic mutable reference to the internal value if it is Spinner
.
sourcepub fn as_display(&self) -> Option<&(dyn Display + 'static)>where
T: Display + 'static,
pub fn as_display(&self) -> Option<&(dyn Display + 'static)>where T: Display + 'static,
Get a dynamic reference to the internal value if it is Display
.
sourcepub fn as_bar(&self) -> Option<&(dyn ProgressBar + 'static)>where
T: ProgressBar + 'static,
pub fn as_bar(&self) -> Option<&(dyn ProgressBar + 'static)>where T: ProgressBar + 'static,
Get a dynamic reference to the internal value if it is ProgressBar
sourcepub fn as_spinner(&self) -> Option<&(dyn Spinner + 'static)>where
T: Spinner + 'static,
pub fn as_spinner(&self) -> Option<&(dyn Spinner + 'static)>where T: Spinner + 'static,
Get a dynamic reference to the internal value if it is Spinner
.
Trait Implementations§
source§impl<T: Debug> Debug for MaybeSilent<T>
impl<T: Debug> Debug for MaybeSilent<T>
source§impl<T> Display for MaybeSilent<T>where
T: Display,
impl<T> Display for MaybeSilent<T>where T: Display,
source§fn update_dimensions(&mut self, to: usize)
fn update_dimensions(&mut self, to: usize)
source§impl<T> From<MaybeSilent<T>> for Option<T>
impl<T> From<MaybeSilent<T>> for Option<T>
source§fn from(from: MaybeSilent<T>) -> Self
fn from(from: MaybeSilent<T>) -> Self
source§impl<T> From<Option<T>> for MaybeSilent<T>
impl<T> From<Option<T>> for MaybeSilent<T>
source§impl<T> ProgressBar for MaybeSilent<T>where
T: ProgressBar,
impl<T> ProgressBar for MaybeSilent<T>where T: ProgressBar,
fn set_progress(&mut self, value: f64)
fn get_progress(&self) -> f64
source§impl<T> Spinner for MaybeSilent<T>where
T: Spinner,
impl<T> Spinner for MaybeSilent<T>where T: Spinner,
source§impl<T> WithTitle for MaybeSilent<T>where
T: WithTitle,
impl<T> WithTitle for MaybeSilent<T>where T: WithTitle,
A trait for creating a progress bar or spinner with a title.