pub struct OneshotTimer<Ctx> { /* private fields */ }Implementations§
Source§impl<Ctx> OneshotTimer<Ctx>
impl<Ctx> OneshotTimer<Ctx>
pub async fn create(context: &mut Ctx) -> Result<Self, TimerError>
pub async fn schedule_once_at<M: Into<AnyMessage>>( &mut self, at: Instant, message: M, ) -> Result<OneshotKey, TimerError>
pub async fn schedule_once_after<M: Into<AnyMessage>>( &mut self, after: Duration, message: M, ) -> Result<OneshotKey, TimerError>
pub async fn cancel( &mut self, key: OneshotKey, ) -> Result<Option<AnyMessage>, TimerError>
Trait Implementations§
Source§impl<Ctx: Clone> Clone for OneshotTimer<Ctx>
impl<Ctx: Clone> Clone for OneshotTimer<Ctx>
Source§fn clone(&self) -> OneshotTimer<Ctx>
fn clone(&self) -> OneshotTimer<Ctx>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<Ctx> Freeze for OneshotTimer<Ctx>where
Ctx: Freeze,
impl<Ctx> RefUnwindSafe for OneshotTimer<Ctx>where
Ctx: RefUnwindSafe,
impl<Ctx> Send for OneshotTimer<Ctx>where
Ctx: Send,
impl<Ctx> Sync for OneshotTimer<Ctx>where
Ctx: Sync,
impl<Ctx> Unpin for OneshotTimer<Ctx>where
Ctx: Unpin,
impl<Ctx> UnwindSafe for OneshotTimer<Ctx>where
Ctx: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more