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 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)
Update the max size if needed
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
Converts to this type from the input type.
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,
A trait for creating a progress bar or spinner with a title.
impl<T> WithTitle for MaybeSilent<T>where
T: WithTitle,
A trait for creating a progress bar or spinner with a title.
Auto Trait Implementations§
impl<T> Freeze for MaybeSilent<T>where
T: Freeze,
impl<T> RefUnwindSafe for MaybeSilent<T>where
T: RefUnwindSafe,
impl<T> Send for MaybeSilent<T>where
T: Send,
impl<T> Sync for MaybeSilent<T>where
T: Sync,
impl<T> Unpin for MaybeSilent<T>where
T: Unpin,
impl<T> UnwindSafe for MaybeSilent<T>where
T: UnwindSafe,
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