pub fn new(len: u64, refresh_rate: u64, prefix: String) -> Self {
        let progress_bar = ProgressBar::hidden();
        progress_bar.set_length(len);
        progress_bar.set_prefix(prefix);
        progress_bar.set_style(
            ProgressStyle::default_bar()
                .template(
                    "{prefix}[{bar:40}] [{elapsed_precise}] {percent:>3}%",
                )
                .progress_chars("=>-"),
        );
        let pb = Arc::new(progress_bar);
        let pb2 = pb.clone();
        let counter = Arc::new(RelaxedCounter::new(0));
        let counter2 = counter.clone();
        thread::spawn(move || {
            while Arc::strong_count(&counter2) > 1 && !pb2.is_finished() {
                pb2.set_position(counter2.get() as u64);
                thread::sleep(Duration::from_millis(refresh_rate));
            }
        });
        Self { counter, pbar: pb }
    }
/// Creates the Bar struct with a size, refresh_rate and prefix for the bar.
/// The returned Bar is hidden.
Creates the Bar struct with a size, refresh_rate and prefix for the bar.
The returned Bar is hidden.
Creates the Bar struct with a size refresh_rate and prefix for the bar . The returned Bar is hidden .
pub fn new(len: u64, refresh_rate: u64, prefix: String) -> Self {
        let progress_bar = ProgressBar::hidden();
        progress_bar.set_length(len);
        progress_bar.set_prefix(prefix);
        progress_bar.set_style(
            ProgressStyle::default_bar()
                .template(
                    "{prefix}[{bar:40}] [{elapsed_precise}] {percent:>3}%",
                )
                .progress_chars("=>-"),
        );
        let pb = Arc::new(progress_bar);
        let pb2 = pb.clone();
        let counter = Arc::new(RelaxedCounter::new(0));
        let counter2 = counter.clone();
        thread::spawn(move || {
            while Arc::strong_count(&counter2) > 1 && !pb2.is_finished() {
                pb2.set_position(counter2.get() as u64);
                thread::sleep(Duration::from_millis(refresh_rate));
            }
        });
        Self { counter, pbar: pb }
    }
pub fn new ( len : u64 , refresh_rate : u64 , prefix : String ) -> Self { let progress_bar = ProgressBar :: hidden ( ) ; progress_bar . set_length ( len ) ; progress_bar . set_prefix ( prefix ) ; progress_bar . set_style ( ProgressStyle :: default_bar ( ) . template ( " " , ) . progress_chars ( " " ) , ) ; let pb = Arc :: new ( progress_bar ) ; let pb2 = pb . clone ( ) ; let counter = Arc :: new ( RelaxedCounter :: new ( 0 ) ) ; let counter2 = counter . clone ( ) ; thread :: spawn ( move | | { while Arc :: strong_count ( & counter2 ) > 1 && ! pb2 . is_finished ( ) { pb2 . set_position ( counter2 . get ( ) as u64 ) ; thread :: sleep ( Duration :: from_millis ( refresh_rate ) ) ; } } ) ; Self { counter , pbar : pb } }
Creates the Bar struct with a size, refresh_rate and prefix for the bar.
Creates the Bar struct with a size refresh_rate and prefix for the bar .
len
u64
refresh_rate
u64
prefix
String
len
u64
refresh_rate
u64
prefix
String