Struct crs_bind::rtos::Instant[][src]

pub struct Instant(_);

Represents a time on a monotonically increasing clock (i.e., time since program start).

This type has a precision of 1 millisecond.

Implementations

impl Instant[src]

pub fn from_millis(millis: u32) -> Self[src]

Creates a new Instant from the specified number of whole milliseconds since program start.

pub fn from_secs(secs: u32) -> Self[src]

Creates a new Instant from the specified number of whole seconds since program start.

pub fn as_millis(&self) -> u32[src]

Returns the number of whole seconds since program start contained by this Instant.

The returned value does not include the fractional (milliseconds) part of the time value.

pub fn as_secs(&self) -> u32[src]

Returns the number of whole milliseconds since program start contained by this Instant.

pub fn subsec_millis(&self) -> u32[src]

Returns the fractional part of this Instant, in whole milliseconds.

This method does not return the time value in milliseconds. The returned number always represents a fractional portion of a second (i.e., it is less than one thousand).

pub fn checked_add(self, rhs: Duration) -> Option<Self>[src]

Checked addition of a Duration to an Instant. Computes self + rhs, returning None if overflow occurred.

pub fn checked_sub(self, rhs: Duration) -> Option<Instant>[src]

Checked subtraction of a Duration from an Instant. Computes self - rhs, returning None if the result would be negative or overflow occurred.

pub fn checked_sub_instant(self, rhs: Self) -> Option<Duration>[src]

Checked subtraction of two Instants. Computes self - rhs, returning None if the result would be negative or overflow occurred.

pub fn checked_mul(self, rhs: u32) -> Option<Instant>[src]

Checked multiplication of an Instant by a scalar. Computes self * rhs, returning None if an overflow occurred.

Trait Implementations

impl Add<Duration> for Instant[src]

type Output = Instant

The resulting type after applying the + operator.

impl Clone for Instant[src]

impl Copy for Instant[src]

impl Debug for Instant[src]

impl Display for Instant[src]

impl Div<u32> for Instant[src]

type Output = Instant

The resulting type after applying the / operator.

impl Eq for Instant[src]

impl Mul<u32> for Instant[src]

type Output = Instant

The resulting type after applying the * operator.

impl Ord for Instant[src]

impl PartialEq<Instant> for Instant[src]

impl PartialOrd<Instant> for Instant[src]

impl StructuralEq for Instant[src]

impl StructuralPartialEq for Instant[src]

impl Sub<Duration> for Instant[src]

type Output = Instant

The resulting type after applying the - operator.

impl Sub<Instant> for Instant[src]

type Output = Duration

The resulting type after applying the - operator.

Auto Trait Implementations

impl Send for Instant

impl Sync for Instant

impl Unpin for Instant

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.