[][src]Struct logbar::Style

pub struct Style { /* fields omitted */ }

Progress bar style

Methods

impl Style[src]

pub fn new() -> Self[src]

Default progress bar style

Example

Create a progress bar, explicitly asking for the default style:

let style = logbar::Style::new();
let max_progress = 100;
let bar = logbar::ProgressBar::with_style(max_progress, style);

pub fn width(self, width: usize) -> Self[src]

Set the progress bar width in characters

Example

Create a progress bar with a width of 80 characters:

let style = logbar::Style::new().width(80);
let max_progress = 100;
let bar = logbar::ProgressBar::with_style(max_progress, style);

pub fn labels(self, labels: bool) -> Self[src]

Toggle progress bar labels of the form XX%

Example

Create a progress bar without labels:

let style = logbar::Style::new().labels(false);
let max_progress = 100;
let bar = logbar::ProgressBar::with_style(max_progress, style);

pub fn tick(self, tick: char) -> Self[src]

Choose a "tick" character separating the progress bar segments

Example

Create a progress bar with '↓' as tick character:

let style = logbar::Style::new().tick('↓');
let max_progress = 100;
let bar = logbar::ProgressBar::with_style(max_progress, style);

pub fn bar(self, bar: char) -> Self[src]

Choose a character for the progress bar segments

Example

Create a progress bar made out of '-' characters, separated by the default "tick" character.

let style = logbar::Style::new().bar('-');
let max_progress = 100;
let bar = logbar::ProgressBar::with_style(max_progress, style);

pub fn indicator(self, indicator: char) -> Self[src]

Choose a progress indicator

Example

Create a progress bar where the progress is indicated by the number of '█' characters.

let style = logbar::Style::new().indicator('█');
let max_progress = 100;
let bar = logbar::ProgressBar::with_style(max_progress, style);

Trait Implementations

impl Clone for Style[src]

impl Debug for Style[src]

impl Default for Style[src]

fn default() -> Self[src]

Default progress bar style

Example

Create a progress bar, explicitly asking for the default style:

let style = logbar::Style::default();
let max_progress = 100;
let bar = logbar::ProgressBar::with_style(max_progress, style);

impl Eq for Style[src]

impl Hash for Style[src]

impl Ord for Style[src]

impl PartialEq<Style> for Style[src]

impl PartialOrd<Style> for Style[src]

impl StructuralEq for Style[src]

impl StructuralPartialEq for Style[src]

Auto Trait Implementations

impl RefUnwindSafe for Style

impl Send for Style

impl Sync for Style

impl Unpin for Style

impl UnwindSafe for Style

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.