[][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 PartialEq<Style> for Style[src]

impl Clone for Style[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Ord for Style[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

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 PartialOrd<Style> for Style[src]

impl Debug for Style[src]

impl Hash for Style[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for Style

impl Sync for Style

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.

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

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

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