pub struct Spinner { /* private fields */ }Expand description
Lightweight wrapper around indicatif’s spinner progress bar with
convenience helpers for printing output while the spinner is active.
Implementations§
Source§impl Spinner
impl Spinner
Sourcepub fn new_with_output_below(message: String) -> Self
pub fn new_with_output_below(message: String) -> Self
Start a spinner intended to have output printed underneath it.
(This currently behaves the same as new, but exists to preserve the
semantics of the previous implementation and allow future tweaks.)
Sourcepub fn println<T: AsRef<str>>(&self, message: T)
pub fn println<T: AsRef<str>>(&self, message: T)
Print a line while keeping the spinner intact.
Sourcepub fn printer(&self) -> SpinnerPrinter
pub fn printer(&self) -> SpinnerPrinter
Obtain a cloneable printer handle that can be used to emit lines from other parts of the code while the spinner remains active.
Sourcepub fn suspend<F: FnOnce()>(&self, f: F)
pub fn suspend<F: FnOnce()>(&self, f: F)
Temporarily suspend the spinner while executing the provided closure.
Sourcepub fn stop_with_message(&self, message: &str)
pub fn stop_with_message(&self, message: &str)
Stop the spinner and replace it with a final message.
Sourcepub fn update_message(&self, new_message: String)
pub fn update_message(&self, new_message: String)
Update the spinner message while it is running.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Spinner
impl RefUnwindSafe for Spinner
impl Send for Spinner
impl Sync for Spinner
impl Unpin for Spinner
impl UnwindSafe for Spinner
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more