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

pub trait Extensions: TimeInt {
    fn nanoseconds(self) -> Nanoseconds<Self> { ... }
fn microseconds(self) -> Microseconds<Self> { ... }
fn milliseconds(self) -> Milliseconds<Self> { ... }
fn seconds(self) -> Seconds<Self> { ... }
fn minutes(self) -> Minutes<Self> { ... }
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

fn nanoseconds(self) -> Nanoseconds<Self>

nanoseconds

fn microseconds(self) -> Microseconds<Self>

microseconds

fn milliseconds(self) -> Milliseconds<Self>

milliseconds

fn seconds(self) -> Seconds<Self>

seconds

fn minutes(self) -> Minutes<Self>

minutes

fn hours(self) -> Hours<Self>

hours

Loading content...

Implementors

impl Extensions for u32[src]

impl Extensions for u64[src]

Loading content...