Trait embedded_time::fixed_point::FixedPoint[][src]

pub trait FixedPoint: Sized + Copy {
    type T: TimeInt;

    const SCALING_FACTOR: Fraction;

    fn integer(&self) -> Self::T;

    fn checked_mul(&self, rhs: &Self::T) -> Option<Self> { ... }
fn checked_div(&self, rhs: &Self::T) -> Option<Self> { ... }
fn min_value() -> Self::T { ... }
fn max_value() -> Self::T { ... } }
Expand description

Fixed-point value type

QX.32 where X: bit-width of T

Associated Types

type T: TimeInt[src]

The integer (magnitude) type

Associated Constants

const SCALING_FACTOR: Fraction[src]

The fractional scaling factor

Required methods

fn integer(&self) -> Self::T[src]

Returns the integer part of the FixedPoint value

assert_eq!(Hertz(45_u32).integer(), 45_u32);

Provided methods

fn checked_mul(&self, rhs: &Self::T) -> Option<Self>[src]

Multiply with overflow checking

fn checked_div(&self, rhs: &Self::T) -> Option<Self>[src]

Multiply with overflow checking

fn min_value() -> Self::T[src]

Returns the minimum integer value

fn max_value() -> Self::T[src]

Returns the maximum integer value

Implementors

impl<T: TimeInt> FixedPoint for Hours<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Microseconds<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Milliseconds<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Minutes<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Nanoseconds<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Seconds<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Baud<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for BitsPerSecond<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for BytesPerSecond<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Centihertz<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Decihertz<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Hertz<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Kibibaud<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for KibibitsPerSecond<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for KibibytesPerSecond<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Kibihertz<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Kilobaud<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for KilobitsPerSecond<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for KilobytesPerSecond<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Kilohertz<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Mebibaud<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for MebibitsPerSecond<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for MebibytesPerSecond<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Mebihertz<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Megabaud<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for MegabitsPerSecond<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for MegabytesPerSecond<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Megahertz<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Microhertz<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]

impl<T: TimeInt> FixedPoint for Millihertz<T>[src]

fn integer(&self) -> Self::T[src]

type T = T

const SCALING_FACTOR: Fraction[src]

fn new(value: Self::T) -> Self[src]