pub struct Spinner { /* private fields */ }
Expand description
A wrapper around indicatif’s ProgressBar for easy spinner management
Implementations§
Source§impl Spinner
impl Spinner
Sourcepub fn new_download_style(message: &str, total_size: u64) -> Self
pub fn new_download_style(message: &str, total_size: u64) -> Self
Create a new spinner with a download-style progress bar
Sourcepub fn set_message(&self, message: &str)
pub fn set_message(&self, message: &str)
Update the spinner message
Sourcepub fn set_position(&self, pos: u64)
pub fn set_position(&self, pos: u64)
Set the position for progress bar (useful for download-style spinners)
Sourcepub fn set_length(&self, len: u64)
pub fn set_length(&self, len: u64)
Set the total size for progress bar
Sourcepub fn finish_with_message(&self, message: &str)
pub fn finish_with_message(&self, message: &str)
Finish the spinner with a success message
Sourcepub fn finish_and_clear(&self)
pub fn finish_and_clear(&self)
Finish the spinner and clear the line
Sourcepub fn finish_with_error(&self, message: &str)
pub fn finish_with_error(&self, message: &str)
Finish the spinner with an error message
Sourcepub fn clone_inner(&self) -> ProgressBar
pub fn clone_inner(&self) -> ProgressBar
Get a clone of the ProgressBar for use in other threads
Sourcepub fn new_async(message: &str) -> Self
pub fn new_async(message: &str) -> Self
Create a new spinner that runs in a tokio task for better async integration
Sourcepub fn spawn_async(self) -> JoinHandle<()>
pub fn spawn_async(self) -> JoinHandle<()>
Run the spinner in a tokio task and return a handle to control it
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