pub struct Spinner { /* private fields */ }Expand description
A simple spinner for single-step or short sequential operations.
Automatically disables itself when stderr is not a TTY (e.g. piped output) or when the output does not allow progress (e.g. inside the TUI). A hidden spinner writes its messages as plain lines to the output’s error channel.
Implementations§
Source§impl Spinner
impl Spinner
Sourcepub fn new(message: &str, output: &Output) -> Self
pub fn new(message: &str, output: &Output) -> Self
Creates and starts a spinner with the given message. A hidden spinner writes the message as a note.
Sourcepub fn set_message(&self, message: impl Into<String>)
pub fn set_message(&self, message: impl Into<String>)
Updates the spinner message in-place.
Sourcepub fn finish_warn(&self, message: &str)
pub fn finish_warn(&self, message: &str)
Finishes the spinner with a warning message.
Sourcepub fn finish_and_clear(&self)
pub fn finish_and_clear(&self)
Finishes and clears the spinner line (no residual output).
Auto Trait Implementations§
impl Forget for Spinner
impl Freeze for Spinner
impl RefUnwindSafe for Spinner
impl Send for Spinner
impl Sync for Spinner
impl Unpin for Spinner
impl UnsafeUnpin 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