pub struct Delay { /* private fields */ }
Available on crate feature
time
only.Expand description
Future returned by delay_until
and
delay_for
.
Implementations§
Source§impl Delay
impl Delay
Sourcepub fn is_elapsed(&self) -> bool
pub fn is_elapsed(&self) -> bool
Returns true if the Delay
has elapsed
A Delay
is elapsed when the requested duration has elapsed.
Sourcepub fn reset(&mut self, deadline: Instant)
pub fn reset(&mut self, deadline: Instant)
Reset the Delay
instance to a new deadline.
Calling this function allows changing the instant at which the Delay
future completes without having to create new associated state.
This function can be called both before and after the future has completed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Delay
impl !RefUnwindSafe for Delay
impl Send for Delay
impl Sync for Delay
impl Unpin for Delay
impl !UnwindSafe for Delay
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
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more