[][src]Struct progressing::mapping::Bar

pub struct Bar<N> { /* fields omitted */ }

A progress-bar mapping values from [a, b] (e.g. [-9, 5]) to [0, 1].

use progressing::{mapping::Bar as MappingBar, Baring};

/// Mapping from [-9, 5] to [0, 1]
/// [================>-] (4 / 5)
fn main() {
    println!("Mapping from [-9, 5] to [0, 1]");
    let mut progress_bar = MappingBar::with_range(-9, 5);
    progress_bar.set_len(20);
    progress_bar.set(4);
    println!("{}", progress_bar);
}

Implementations

impl<N> Bar<N> where
    N: Clone
[src]

pub fn with_range(from: N, to: N) -> Bar<N>[src]

pub fn with(cfg: Config<N>) -> Bar<N>[src]

pub fn timed(self) -> Bar<Bar<N>> where
    Bar<N>: Baring
[src]

Trait Implementations

impl Baring for Bar<usize>[src]

type Progress = usize

impl Baring for Bar<i64>[src]

type Progress = i64

impl Baring for Bar<i32>[src]

type Progress = i32

impl<N: Debug> Debug for Bar<N>[src]

impl<N> Display for Bar<N> where
    N: Display,
    Bar<N>: Baring,
    <Bar<N> as Baring>::Progress: Display
[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for Bar<N> where
    N: RefUnwindSafe

impl<N> Send for Bar<N> where
    N: Send

impl<N> Sync for Bar<N> where
    N: Sync

impl<N> Unpin for Bar<N> where
    N: Unpin

impl<N> UnwindSafe for Bar<N> where
    N: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.