rtic_monotonics::systick::prelude

Trait ExtU32

Source
pub trait ExtU32 {
    // Required methods
    fn nanos<const NOM: u32, const DENOM: u32>(
        self,
    ) -> Duration<u32, NOM, DENOM>;
    fn micros<const NOM: u32, const DENOM: u32>(
        self,
    ) -> Duration<u32, NOM, DENOM>;
    fn millis<const NOM: u32, const DENOM: u32>(
        self,
    ) -> Duration<u32, NOM, DENOM>;
    fn secs<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>;
    fn minutes<const NOM: u32, const DENOM: u32>(
        self,
    ) -> Duration<u32, NOM, DENOM>;
    fn hours<const NOM: u32, const DENOM: u32>(
        self,
    ) -> Duration<u32, NOM, DENOM>;
}
Expand description

Extension trait for simple short-hands for u32 Durations

Required Methods§

Source

fn nanos<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Shorthand for creating a duration which represents nanoseconds.

Source

fn micros<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Shorthand for creating a duration which represents microseconds.

Source

fn millis<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Shorthand for creating a duration which represents milliseconds.

Source

fn secs<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Shorthand for creating a duration which represents seconds.

Source

fn minutes<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Shorthand for creating a duration which represents minutes.

Source

fn hours<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Shorthand for creating a duration which represents hours.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ExtU32 for u32

Source§

fn nanos<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Source§

fn micros<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Source§

fn millis<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Source§

fn secs<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Source§

fn minutes<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Source§

fn hours<const NOM: u32, const DENOM: u32>(self) -> Duration<u32, NOM, DENOM>

Implementors§