Trait drv8825::embedded_time::duration::Extensions[][src]

pub trait Extensions: TimeInt {
    pub fn nanoseconds(self) -> Nanoseconds<Self> { ... }
pub fn microseconds(self) -> Microseconds<Self> { ... }
pub fn milliseconds(self) -> Milliseconds<Self> { ... }
pub fn seconds(self) -> Seconds<Self> { ... }
pub fn minutes(self) -> Minutes<Self> { ... }
pub fn hours(self) -> Hours<Self> { ... } }

Create duration-based extensions from primitive numeric types.

use embedded_time::duration::*;

assert_eq!(5_u32.nanoseconds(), Nanoseconds(5_u32));
assert_eq!(5_u32.microseconds(), Microseconds(5_u32));
assert_eq!(5_u32.milliseconds(), Milliseconds(5_u32));
assert_eq!(5_u32.seconds(), Seconds(5_u32));
assert_eq!(5_u32.minutes(), Minutes(5_u32));
assert_eq!(5_u32.hours(), Hours(5_u32));

Provided methods

pub fn nanoseconds(self) -> Nanoseconds<Self>[src]

nanoseconds

pub fn microseconds(self) -> Microseconds<Self>[src]

microseconds

pub fn milliseconds(self) -> Milliseconds<Self>[src]

milliseconds

pub fn seconds(self) -> Seconds<Self>[src]

seconds

pub fn minutes(self) -> Minutes<Self>[src]

minutes

pub fn hours(self) -> Hours<Self>[src]

hours

Loading content...

Implementors

impl Extensions for u32[src]

impl Extensions for u64[src]

Loading content...