Struct DurationRepr

Source
pub struct DurationRepr<'a> {
    pub default_unit: TimeUnit,
    pub unit: Option<TimeUnit>,
    pub is_negative: Option<bool>,
    pub is_infinite: bool,
    pub whole: Option<Whole>,
    pub fract: Option<Fract>,
    pub input: &'a [u8],
    pub exponent: i16,
    pub multiplier: Multiplier,
    pub numeral: Option<Multiplier>,
}

Fields§

§default_unit: TimeUnit§unit: Option<TimeUnit>§is_negative: Option<bool>§is_infinite: bool§whole: Option<Whole>§fract: Option<Fract>§input: &'a [u8]§exponent: i16§multiplier: Multiplier§numeral: Option<Multiplier>

Implementations§

Source§

impl<'a> DurationRepr<'a>

Source

pub fn parse(&mut self) -> Result<Duration, ParseError>

Source

pub fn parse_duration_with_fixed_number( &self, coefficient: i64, exponent: i16, ) -> Duration

Source

pub fn calculate_duration( is_negative: bool, seconds: u64, attos: u64, coefficient: i64, ) -> Duration

Trait Implementations§

Source§

impl<'a> Debug for DurationRepr<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for DurationRepr<'a>

Source§

fn default() -> DurationRepr<'a>

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

Auto Trait Implementations§

§

impl<'a> Freeze for DurationRepr<'a>

§

impl<'a> RefUnwindSafe for DurationRepr<'a>

§

impl<'a> Send for DurationRepr<'a>

§

impl<'a> Sync for DurationRepr<'a>

§

impl<'a> Unpin for DurationRepr<'a>

§

impl<'a> UnwindSafe for DurationRepr<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.