Struct loading_bar::loading_bar::LoadingBar
source · [−]pub struct LoadingBar { /* private fields */ }
Implementations
sourceimpl LoadingBar
impl LoadingBar
these methods/functions are used to auomatically generate and or update the loading bar
Note: because I don’t fully understand threads and mutexes, you can’t acces the loading bar once it’s been used in one of these methods.
pub fn auto_run(
time_in_seconds: u16,
len: u16,
start: u16,
color: Option<Color>,
start_pos: (u16, u16)
)
pub fn auto_run_change(
change: Vec<Option<Color>>,
time_in_seconds: u16,
len: u16,
start: u16,
start_pos: (u16, u16)
)
pub fn auto_run_from(loading_bar: LoadingBar, time_in_seconds: u16)
pub fn auto_run_change_points(
change: HashMap<u16, Option<Color>>,
time_in_seconds: u16,
len: u16,
start: u16,
start_pos: (u16, u16)
)
pub fn auto_run_from_change(
loading_bar: LoadingBar,
change: Vec<Option<Color>>,
time_in_seconds: u16
)
pub fn auto_run_from_change_points<T, U>(
loading_bar: LoadingBar,
change: HashMap<T, U>,
time_in_seconds: u16,
type_change: Types
) where
T: Copy + Debug,
u16: From<T>,
f32: From<T>,
U: Copy + Debug + Send + 'static,
Option<Color>: From<U>,
sourceimpl LoadingBar
impl LoadingBar
sourcepub fn change_pos(&mut self, pos: (u16, u16))
pub fn change_pos(&mut self, pos: (u16, u16))
this is used to change the position of the loading bar in the terminal using (x, y)
Arguments Pos: Position of the loading bar in the terminal using (x, y)
it will cleear the old position and move to the new position (but not print anything)
sourcepub fn change_pos_print(&mut self, pos: (u16, u16))
pub fn change_pos_print(&mut self, pos: (u16, u16))
this is the same as change_pos but it also prints the the loading bar
pub fn advance(&mut self)
pub fn advance_print(&mut self)
pub fn advance_by(&mut self, index: u16)
pub fn advance_by_print(&mut self, index: u16)
pub fn change_character_type(&mut self, character: char)
pub fn change_last_character(&mut self, character: char)
pub fn change_bracket_color(&mut self, color: Option<Color>)
pub fn change_bracket_color_print(&mut self, color: Option<Color>)
pub fn change_last_character_print(&mut self, character: char)
pub fn change_character_type_print(&mut self, character: char)
pub fn advance_by_percent(&mut self, percentage: f32)
pub fn advance_by_percent_print(&mut self, percentage: f32)
pub fn change_color(&mut self, color: Option<Color>)
pub fn change_color_print(&mut self, color: Option<Color>)
pub fn change(&mut self, map: HashMap<&str, LoadingBarOptions>, print: bool)
pub fn print(&self)
Trait Implementations
sourceimpl Clone for LoadingBar
impl Clone for LoadingBar
sourcefn clone(&self) -> LoadingBar
fn clone(&self) -> LoadingBar
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LoadingBar
impl Debug for LoadingBar
Auto Trait Implementations
impl RefUnwindSafe for LoadingBar
impl Send for LoadingBar
impl Sync for LoadingBar
impl Unpin for LoadingBar
impl UnwindSafe for LoadingBar
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more