Struct async_hal::delay::Timer

source ·
pub struct Timer<T, S> { /* private fields */ }

Implementations§

source§

impl<T, S> Timer<T, S>

source

pub const fn new(timer: T, scheduler: S) -> Self

Trait Implementations§

source§

impl<T, S> DelayMs for Timer<T, S>where T: CountDown + Cancel + Unpin, T::Time: From<MillisDurationU32>, S: Scheduler + Unpin,

§

type Delay = u32

The type of duration to delay for.
§

type Error = <T as Cancel>::Error

The error returned on failure.
source§

fn start(&mut self, ms: Self::Delay) -> Result<(), Self::Error>

Start a new delay.
source§

fn cancel(&mut self) -> Result<(), Self::Error>

Attempt to cancel a delay in progress.
source§

fn poll_delay_ms( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<(), Self::Error>>

Poll a delay of ms milliseconds.
source§

fn poll_delay_ms_unpin( &mut self, cx: &mut Context<'_> ) -> Poll<Result<(), Self::Error>>where Self: Unpin,

source§

fn delay_ms(&mut self, ms: Self::Delay) -> DelayMsFuture<'_, Self> where Self: Unpin,

Delay for ms milliseconds. Starts a new delay and returns a Future that completes when either the timer expires. The returned future also implements [Stream] if this delay is Periodic. Read more

Auto Trait Implementations§

§

impl<T, S> RefUnwindSafe for Timer<T, S>where S: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, S> Send for Timer<T, S>where S: Send, T: Send,

§

impl<T, S> Sync for Timer<T, S>where S: Sync, T: Sync,

§

impl<T, S> Unpin for Timer<T, S>where S: Unpin, T: Unpin,

§

impl<T, S> UnwindSafe for Timer<T, S>where S: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.