Delay

Struct Delay 

Source
pub struct Delay<'a, CLOCK: Clock> { /* private fields */ }
Expand description

An instance of a delay tied to a specific Clock.

Implementations§

Source§

impl<'a, CLOCK: Clock> Delay<'a, CLOCK>

Source

pub fn new(clock: &'a CLOCK) -> Self

Creates a new Delay for the given underlying clock

Source

pub fn delay(&mut self, delay: Duration)

Blocks execution for (at least) the duration of delay

Trait Implementations§

Source§

impl<'a, CLOCK: Debug + Clock> Debug for Delay<'a, CLOCK>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, CLOCK: Clock> DelayNs for Delay<'a, CLOCK>

Source§

fn delay_ns(&mut self, ns: u32)

Pauses execution for at minimum ns nanoseconds. Pause can be longer if the implementation requires it due to precision/timing issues.
Source§

fn delay_us(&mut self, us: u32)

Pauses execution for at minimum us microseconds. Pause can be longer if the implementation requires it due to precision/timing issues.
Source§

fn delay_ms(&mut self, ms: u32)

Pauses execution for at minimum ms milliseconds. Pause can be longer if the implementation requires it due to precision/timing issues.

Auto Trait Implementations§

§

impl<'a, CLOCK> Freeze for Delay<'a, CLOCK>

§

impl<'a, CLOCK> RefUnwindSafe for Delay<'a, CLOCK>
where CLOCK: RefUnwindSafe,

§

impl<'a, CLOCK> Send for Delay<'a, CLOCK>
where CLOCK: Sync,

§

impl<'a, CLOCK> Sync for Delay<'a, CLOCK>
where CLOCK: Sync,

§

impl<'a, CLOCK> Unpin for Delay<'a, CLOCK>

§

impl<'a, CLOCK> UnwindSafe for Delay<'a, CLOCK>
where CLOCK: RefUnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.