[][src]Struct embedded_time::duration::time_units::Seconds

pub struct Seconds<T: TimeRep>(pub T);

See module-level documentation for details about this type

Trait Implementations

impl<Rep, RhsDur> Add<RhsDur> for Seconds<Rep> where
    RhsDur: Duration,
    RhsDur::Rep: TimeRep,
    Rep: TimeRep + TryFrom<RhsDur::Rep, Error: Debug>, 
[src]

See module-level documentation for details about this type

type Output = Self

The resulting type after applying the + operator.

fn add(self, rhs: RhsDur) -> Self::Output[src]

See module-level documentation for details about this type

impl<T: Clone + TimeRep> Clone for Seconds<T>[src]

impl<T: Copy + TimeRep> Copy for Seconds<T>[src]

impl<T: Debug + TimeRep> Debug for Seconds<T>[src]

impl<T: TimeRep> Display for Seconds<T>[src]

See module-level documentation for details about this type

fn fmt(&self, f: &mut Formatter) -> Result[src]

See module-level documentation for details about this type

impl<Rep: TimeRep> Duration for Seconds<Rep>[src]

type Rep = Rep

impl<T: Eq + TimeRep> Eq for Seconds<T>[src]

impl<T: Ord + TimeRep> Ord for Seconds<T>[src]

impl<Rep, OtherDur> PartialEq<OtherDur> for Seconds<Rep> where
    Rep: TimeRep + TryFrom<OtherDur::Rep, Error: Debug>,
    OtherDur: Duration,
    OtherDur::Rep: TryFrom<Rep, Error: Debug>, 
[src]

See module-level documentation for details about this type

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

See module-level documentation for details about this type

impl<Rep, OtherDur> PartialOrd<OtherDur> for Seconds<Rep> where
    Rep: TimeRep + TryFrom<OtherDur::Rep, Error: Debug>,
    OtherDur: Duration,
    OtherDur::Rep: TryFrom<Rep, Error: Debug>, 
[src]

See module-level documentation for details about this type

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

See module-level documentation for details about this type

impl<T: TimeRep> StructuralEq for Seconds<T>[src]

impl<Rep, RhsDur> Sub<RhsDur> for Seconds<Rep> where
    Rep: TimeRep + TryFrom<RhsDur::Rep, Error: Debug>,
    RhsDur: Duration
[src]

See module-level documentation for details about this type

type Output = Self

The resulting type after applying the - operator.

fn sub(self, rhs: RhsDur) -> Self::Output[src]

See module-level documentation for details about this type

Auto Trait Implementations

impl<T> Send for Seconds<T> where
    T: Send

impl<T> Sync for Seconds<T> where
    T: Sync

impl<T> Unpin for Seconds<T> where
    T: Unpin

Blanket Implementations

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

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

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

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

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

impl<Source, Dest> TryConvertFrom<Source> for Dest where
    Dest: Duration,
    Source: Duration,
    <Dest as Duration>::Rep: TimeRep,
    <Dest as Duration>::Rep: TryFrom<<Source as Duration>::Rep>,
    <<Dest as Duration>::Rep as TryFrom<<Source as Duration>::Rep>>::Error: Debug,
    <Source as Duration>::Rep: TimeRep
[src]

fn try_convert_from(Source) -> Option<Dest>[src]

Attempt to convert from one duration type to another

Both the underlying storage type and the LSbit period can be converted

Errors

  • unable to cast underlying types
  • LSbit period conversion overflow

Examples

assert_eq!(Seconds::<i32>::try_convert_from(Milliseconds(23_000_i64)), Some(Seconds(23_i32)));
assert_eq!(Seconds::<i64>::try_convert_from(Milliseconds(23_000_i32)), Some(Seconds(23_i64)));

impl<Source, Dest> TryConvertInto<Dest> for Source where
    Dest: Duration + TryConvertFrom<Source>,
    Source: Duration
[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.