[][src]Trait git_features::progress::unit::DisplayValue

pub trait DisplayValue {
    pub fn display_unit(
        &self,
        w: &mut dyn Write,
        value: usize
    ) -> Result<(), Error>; pub fn display_current_value(
        &self,
        w: &mut dyn Write,
        value: usize,
        _upper: Option<usize>
    ) -> Result<(), Error> { ... }
pub fn separator(
        &self,
        w: &mut dyn Write,
        _value: usize,
        _upper: Option<usize>
    ) -> Result<(), Error> { ... }
pub fn display_upper_bound(
        &self,
        w: &mut dyn Write,
        upper_bound: usize,
        _value: usize
    ) -> Result<(), Error> { ... }
pub fn display_percentage(
        &self,
        w: &mut dyn Write,
        percentage: f64
    ) -> Result<(), Error> { ... }
pub fn display_throughput(
        &self,
        w: &mut dyn Write,
        throughput: Throughput
    ) -> Result<(), Error> { ... }
pub fn fraction_and_time_unit(
        &self,
        timespan: Duration
    ) -> (Option<f64>, &'static str) { ... } }

A trait to encapsulate all capabilities needed to display a value with unit within a renderer.

Required methods

pub fn display_unit(&self, w: &mut dyn Write, value: usize) -> Result<(), Error>[src]

Emit the unit of value to w.

The value is provided to add context, even though it is not to be output as part of this method call.

Loading content...

Provided methods

pub fn display_current_value(
    &self,
    w: &mut dyn Write,
    value: usize,
    _upper: Option<usize>
) -> Result<(), Error>
[src]

Display the absolute value representing the current progress of an operation and write it to w.

The upper bound is possibly provided when known to add context, even though it is not to be output as part of this method call.

pub fn separator(
    &self,
    w: &mut dyn Write,
    _value: usize,
    _upper: Option<usize>
) -> Result<(), Error>
[src]

Emit a token to separate two values.

The value and its upper bound are provided to add context, even though it is not to be output as part of this method call.

pub fn display_upper_bound(
    &self,
    w: &mut dyn Write,
    upper_bound: usize,
    _value: usize
) -> Result<(), Error>
[src]

Emit the upper_bound to w.

The value is provided to add context, even though it is not to be output as part of this method call.

pub fn display_percentage(
    &self,
    w: &mut dyn Write,
    percentage: f64
) -> Result<(), Error>
[src]

Emit percentage to w.

pub fn display_throughput(
    &self,
    w: &mut dyn Write,
    throughput: Throughput
) -> Result<(), Error>
[src]

Emit the throughput of an operation to w.

pub fn fraction_and_time_unit(
    &self,
    timespan: Duration
) -> (Option<f64>, &'static str)
[src]

Given a timespan, return a fraction of the timespan based on the given unit, i.e. (possible fraction, unit).

Loading content...

Implementations on Foreign Types

impl DisplayValue for &'static str[src]

Loading content...

Implementors

impl DisplayValue for Bytes[src]

impl DisplayValue for Human[src]

impl DisplayValue for Range[src]

Loading content...