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

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 { ... } }

Fixed-point value type

QX.32 where X: bit-width of T

Associated Types

type T: TimeInt

The integer (magnitude) type

Loading content...

Associated Constants

const SCALING_FACTOR: Fraction

The fractional scaling factor

Loading content...

Required methods

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

Returns the integer part of the FixedPoint value

assert_eq!(Hertz(45_u32).integer(), &45_u32);
Loading content...

Provided methods

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

Multiply with overflow checking

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

Multiply with overflow checking

fn min_value() -> Self::T

Returns the minimum integer value

fn max_value() -> Self::T

Returns the maximum integer value

Loading content...

Implementors

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

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

type T = T

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

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

Loading content...