Struct tokio::time::Sleep [−][src]
Future returned by sleep
and
sleep_until
.
Implementations
impl Sleep
[src][−]
pub fn deadline(&self) -> Instant
[src][−]
Returns the instant at which the future will complete.
pub fn is_elapsed(&self) -> bool
[src][−]
Returns true
if Sleep
has elapsed.
A Sleep
instance is elapsed when the requested duration has elapsed.
pub fn reset(&mut self, deadline: Instant)
[src][−]
Resets the Sleep
instance to a new deadline.
Calling this function allows changing the instant at which the Sleep
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 !RefUnwindSafe for Sleep
impl Send for Sleep
impl Sync for Sleep
impl Unpin for Sleep
impl !UnwindSafe for Sleep
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<F> IntoFuture for F where
F: Future,
[src][+]
F: Future,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,