Unit

Trait Unit 

Source
pub trait Unit {
    // Required methods
    fn one(&self) -> &'static str;
    fn many(&self) -> &'static str;
    fn format(
        &self,
        f: &mut Formatter<'_>,
        value: u64,
        allow_zero: bool,
        started: &mut bool,
    ) -> Result;
}
Expand description

Duration part formatter Unit. Each unit is responsible to format a specific part of the duration

Required Methods§

Source

fn one(&self) -> &'static str

Source

fn many(&self) -> &'static str

Source

fn format( &self, f: &mut Formatter<'_>, value: u64, allow_zero: bool, started: &mut bool, ) -> Result

Implementors§