[][src]Struct progressing::MappingBar

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

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

use progressing::Bar;

/// Mapping from [-9, 5] to [0, 1]
/// [================>-] (4 / 5)
fn main() -> Result<(), String> {
    println!("Mapping from [-9, 5] to [0, 1]");
    let mut progressbar = progressing::MappingBar::new(-9..=5);
    progressbar.set_bar_len(20);
    progressbar.set(4).reprintln()
}

Methods

impl<N> MappingBar<N> where
    MappingBar<N>: Default
[src]

pub fn new(range: RangeInclusive<N>) -> MappingBar<N>[src]

impl MappingBar<usize>[src]

pub fn start(&self) -> usize[src]

pub fn end(&self) -> usize[src]

impl MappingBar<u32>[src]

pub fn start(&self) -> u32[src]

pub fn end(&self) -> u32[src]

impl MappingBar<i32>[src]

pub fn start(&self) -> i32[src]

pub fn end(&self) -> i32[src]

Trait Implementations

impl Bar for MappingBar<usize>[src]

type Progress = usize

impl Bar for MappingBar<u32>[src]

type Progress = u32

impl Bar for MappingBar<i32>[src]

type Progress = i32

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

impl Default for MappingBar<usize>[src]

impl Default for MappingBar<u32>[src]

impl Default for MappingBar<i32>[src]

impl Display for MappingBar<usize>[src]

impl Display for MappingBar<u32>[src]

impl Display for MappingBar<i32>[src]

Auto Trait Implementations

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

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

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

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

impl<N> UnwindSafe for MappingBar<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.