[][src]Trait progressing::Bar

pub trait Bar: Display {
    type Progress;
    fn bar_len(&self) -> usize;
fn set_bar_len(&mut self, new_bar_len: usize);
fn progress(&self) -> Self::Progress;
fn set<P: Into<Self::Progress>>(&mut self, new_progress: P) -> &mut Self;
fn add<P: Into<Self::Progress>>(&mut self, delta: P) -> &mut Self; fn display(&self) -> String { ... }
fn write_to_stdout<S: Into<String>>(&self, msg: S) -> Result<(), String> { ... }
fn print(&self) -> Result<(), String> { ... }
fn println(&self) -> Result<(), String> { ... }
fn reprint(&self) -> Result<(), String> { ... }
fn reprintln(&self) -> Result<(), String> { ... } }

Associated Types

Loading content...

Required methods

fn bar_len(&self) -> usize

fn set_bar_len(&mut self, new_bar_len: usize)

Do not shorten the length before reprinting since the line will be overwritten, not cleared.

[========> ] becomes [====>]==> ] instead of [====>] .

fn progress(&self) -> Self::Progress

fn set<P: Into<Self::Progress>>(&mut self, new_progress: P) -> &mut Self

Sets the progress to the given value

fn add<P: Into<Self::Progress>>(&mut self, delta: P) -> &mut Self

Adds the given progress to the current progress

Loading content...

Provided methods

fn display(&self) -> String

Returns the printable progressbar.

fn write_to_stdout<S: Into<String>>(&self, msg: S) -> Result<(), String>

fn print(&self) -> Result<(), String>

Prints a progressbar using given progress. Does not print a newline-character. Use println(...) for printing a newline-character. Use reprint(...) for overwriting the current stdout-line.

Will return error if writing to stdout throws an error.

fn println(&self) -> Result<(), String>

Prints a progressbar using given progress. In additon to print(...), this function prints a new line. Use reprintln(...) for overwriting the current stdout-line.

Will return error if writing to stdout throws an error.

fn reprint(&self) -> Result<(), String>

Prints the current line again with progressbar using given progress. Does not print a newline-character. Use reprintln(...) for reprinting with a newline-character.

Will return error if writing to stdout throws an error.

fn reprintln(&self) -> Result<(), String>

Prints the current line again with progressbar using given progress. In additon to reprint(...), this function prints a new line. Use println(...) for always printing a newline-character.

Will return error if writing to stdout throws an error.

Loading content...

Implementors

impl Bar for BernoulliBar[src]

type Progress = BernoulliProgress

impl Bar for ClampingBar[src]

type Progress = f32

fn set_bar_len(&mut self, new_bar_len: usize)[src]

panics if length is < 3

impl Bar for MappingBar<i32>[src]

type Progress = i32

impl Bar for MappingBar<u32>[src]

type Progress = u32

Loading content...