pub struct Epoch { /* private fields */ }
Expand description
Epoch implements epoch based deferred execution
Implementations§
Source§impl Epoch
impl Epoch
Sourcepub fn defer<F: FnOnce() + Send + Unpin + 'static>(
&self,
callback: F,
) -> CallbackRef<'_>
pub fn defer<F: FnOnce() + Send + Unpin + 'static>( &self, callback: F, ) -> CallbackRef<'_>
Schedule callback
to be executed when all prior references have been returned. If
callback
is no bigger than usize
, typically no heap allocation will be incurred. If
there are no outstanding guards, callback
will be called immediately.
Sourcepub fn defer_waker(&self, waker: &Waker) -> CallbackRef<'_>
pub fn defer_waker(&self, waker: &Waker) -> CallbackRef<'_>
Same as defer
but for a waker.
Sourcepub fn guard(&self) -> EpochGuard<'_>
pub fn guard(&self) -> EpochGuard<'_>
Takes a guard on the current epoch. Subsequent callbacks queued via defer
are guaranteed
not to be called before this guard is dropped.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Epoch
impl !RefUnwindSafe for Epoch
impl Send for Epoch
impl Sync for Epoch
impl Unpin for Epoch
impl UnwindSafe for Epoch
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