Struct git_features::progress::unit::Range[][src]

pub struct Range {
    pub name: &'static str,
}

A helper for formatting numbers representing ranges in renderers as in 2 of 5 steps.

Fields

name: &'static str

The name of the unit to be appended to the range.

Implementations

impl Range[src]

pub fn new(name: &'static str) -> Range[src]

A convenience method to create a new instance of name.

Trait Implementations

impl Clone for Range[src]

pub fn clone(&self) -> Range[src]

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Debug for Range[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl Default for Range[src]

pub fn default() -> Range[src]

Returns the “default value” for a type. Read more

impl DisplayValue for Range[src]

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. Read more

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

Emit a token to separate two values. Read more

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

Emit the unit of value to w. Read more

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

Emit the upper_bound to w. Read more

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

Emit percentage to w.

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

Emit the throughput of an operation to w.

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).

impl Ord for Range[src]

pub fn cmp(&self, other: &Range) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

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

Restrict a value to a certain interval. Read more

impl PartialEq<Range> for Range[src]

pub fn eq(&self, other: &Range) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

pub fn ne(&self, other: &Range) -> bool[src]

This method tests for !=.

impl PartialOrd<Range> for Range[src]

pub fn partial_cmp(&self, other: &Range) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Copy for Range[src]

impl Eq for Range[src]

impl StructuralEq for Range[src]

impl StructuralPartialEq for Range[src]

Auto Trait Implementations

impl RefUnwindSafe for Range

impl Send for Range

impl Sync for Range

impl Unpin for Range

impl UnwindSafe for Range

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.