pub struct LoadingBar { /* private fields */ }
Implementations§
Source§impl LoadingBar
impl LoadingBar
Sourcepub fn new_with_config(
duration: Duration,
progress_char: char,
length: u32,
prefix: String,
) -> Self
pub fn new_with_config( duration: Duration, progress_char: char, length: u32, prefix: String, ) -> Self
Returns a new LoadingBar with the specified configuration.
§Arguments
duration
- The duration of the loading bar.progress_char
- The character to use for the progress bar.length
- The length of the progress bar in chars.prefix
- The prefix message to print before the progress bar.
§Example
use loadingbar::LoadingBar;
let bar = LoadingBar::new_with_config(
std::time::Duration::from_secs(10), // how long the bar will take to complete
'*', // the character to use for the progress bar
30, // the length of the bar in characters
String::from("Loading.. "), // prefix message (Loading.. [########## ])
);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LoadingBar
impl RefUnwindSafe for LoadingBar
impl Send for LoadingBar
impl Sync for LoadingBar
impl Unpin for LoadingBar
impl UnwindSafe for LoadingBar
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