pub fn create_spinner(message: &str) -> ProgressBarExpand description
Creates a spinner for indeterminate operations.
Spinners are used when the total duration or progress cannot be determined, such as waiting for network responses or performing iterative searches.
§Arguments
message- Initial status message to display next to the spinner
§Returns
A configured ProgressBar in spinner mode with a green spinner animation.
§Display Format
⠋ Connecting to remote storage...
⠙ Connecting to remote storage...
⠹ Connecting to remote storage...§Example
let sp = create_spinner("Initializing...");
std::thread::sleep(std::time::Duration::from_millis(100));
sp.set_message("Connecting...");
std::thread::sleep(std::time::Duration::from_millis(100));
sp.finish_with_message("Ready");§Notes
- The spinner auto-ticks to create the animation effect
- Update the message with
set_message - Call
finishorfinish_with_messagewhen done