Style

Struct Style 

Source
pub struct Style {
    pub value_display: ValueDisplay,
    pub value_suffix: Option<&'static str>,
    pub value_divisor: usize,
    pub left_cap: Symbol,
    pub right_cap: Symbol,
    pub empty_char: Symbol,
    pub done_char: Symbol,
    pub fill_chars: Vec<Symbol>,
}

Fields§

§value_display: ValueDisplay§value_suffix: Option<&'static str>§value_divisor: usize§left_cap: Symbol§right_cap: Symbol§empty_char: Symbol§done_char: Symbol§fill_chars: Vec<Symbol>

Implementations§

Source§

impl Style

Source

pub fn default_ascii() -> Style

Examples found in repository?
examples/simple.rs (line 7)
5fn main()
6{
7    let mut style = Style::default_ascii();
8    style.value_display = ValueDisplay::Percentage;
9    let mut pb = Progresso::new(style);
10
11    pb.set_total(400);
12    for i in 0..401 {
13        pb.erase();
14        pb.set_value(i);
15        pb.draw();
16        thread::sleep(std::time::Duration::from_millis(25));
17    }
18}
Source

pub fn new_smooth_unicode() -> Style

Examples found in repository?
examples/simple_block.rs (line 7)
5fn main()
6{
7    let mut style = Style::new_smooth_unicode();
8    style.value_display = ValueDisplay::Percentage;
9    let mut pb = Progresso::new(style);
10
11    pb.set_total(400);
12    for i in 0..401 {
13        pb.erase();
14        pb.set_value(i);
15        pb.draw();
16        thread::sleep(std::time::Duration::from_millis(5));
17    }
18
19    let mut style = Style::new_climbing_blocks_unicode();
20    style.value_display = ValueDisplay::Percentage;
21    let mut pb = Progresso::new(style);
22
23    pb.set_total(400);
24    for i in 0..401 {
25        pb.erase();
26        pb.set_value(i);
27        pb.draw();
28        thread::sleep(std::time::Duration::from_millis(50));
29    }
30}
Source

pub fn new_climbing_blocks_unicode() -> Style

Examples found in repository?
examples/simple_block.rs (line 19)
5fn main()
6{
7    let mut style = Style::new_smooth_unicode();
8    style.value_display = ValueDisplay::Percentage;
9    let mut pb = Progresso::new(style);
10
11    pb.set_total(400);
12    for i in 0..401 {
13        pb.erase();
14        pb.set_value(i);
15        pb.draw();
16        thread::sleep(std::time::Duration::from_millis(5));
17    }
18
19    let mut style = Style::new_climbing_blocks_unicode();
20    style.value_display = ValueDisplay::Percentage;
21    let mut pb = Progresso::new(style);
22
23    pb.set_total(400);
24    for i in 0..401 {
25        pb.erase();
26        pb.set_value(i);
27        pb.draw();
28        thread::sleep(std::time::Duration::from_millis(50));
29    }
30}

Auto Trait Implementations§

§

impl Freeze for Style

§

impl RefUnwindSafe for Style

§

impl Send for Style

§

impl Sync for Style

§

impl Unpin for Style

§

impl UnwindSafe for Style

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.