Skip to main content

Clock

Struct Clock 

Source
pub struct Clock<'turn, 'd> { /* private fields */ }
Expand description

Read-only access to the monotonic sample installed for one driver turn.

Implementations§

Source§

impl<'turn, 'd> Clock<'turn, 'd>

Source

pub fn now(self) -> Moment<'d>

Returns the one sample installed at the beginning of this turn.

Source

pub fn attach<T>(self, build: impl FnOnce(Instant) -> T) -> Bound<'d, T>

Attaches a raw-time owner to this clock’s driver.

Source

pub fn try_attach<T, E>( self, build: impl FnOnce(Instant) -> Result<T, E>, ) -> Result<Bound<'d, T>, E>

Attaches a fallibly constructed raw-time owner to this driver.

Source

pub fn deadline_at(self, at: Instant) -> Deadline<'d>

Adopts an external absolute instant as this driver’s deadline.

Source

pub fn at<A>(self, access: A) -> At<'d, A>

Binds lexical access to this turn’s canonical sample.

Trait Implementations§

Source§

impl<'turn, 'd> Clone for Clock<'turn, 'd>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'turn, 'd> Copy for Clock<'turn, 'd>

Auto Trait Implementations§

§

impl<'turn, 'd> !RefUnwindSafe for Clock<'turn, 'd>

§

impl<'turn, 'd> !Send for Clock<'turn, 'd>

§

impl<'turn, 'd> !Sync for Clock<'turn, 'd>

§

impl<'turn, 'd> !UnwindSafe for Clock<'turn, 'd>

§

impl<'turn, 'd> Forget for Clock<'turn, 'd>

§

impl<'turn, 'd> Freeze for Clock<'turn, 'd>

§

impl<'turn, 'd> Unpin for Clock<'turn, 'd>

§

impl<'turn, 'd> UnsafeUnpin for Clock<'turn, 'd>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Convert<T> for T

Source§

fn into(self) -> T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.