custom_style/
custom_style.rs1use std::{io, thread, time::Duration};
2
3use spinner_rs::{Color, Spinner, SpinnerStyle, Stream};
4
5fn main() -> io::Result<()> {
6 let mut spinner = Spinner::builder()
7 .text("Processing build graph")
8 .prefix_text("pipeline")
9 .suffix_text("phase-1")
10 .color(Color::Yellow)
11 .spinner(SpinnerStyle::arrow())
12 .indent(4)
13 .stream(Stream::Stderr)
14 .build();
15
16 spinner.start()?;
17 thread::sleep(Duration::from_millis(900));
18
19 spinner.set_suffix_text("phase-2");
20 spinner.set_text("Packing release artifacts");
21 thread::sleep(Duration::from_millis(900));
22
23 spinner.set_color(Some(Color::Green));
24 spinner.succeed(Some("Release artifacts ready"))?;
25 Ok(())
26}