Struct tokio_timer_futures2::Sleep
[−]
[src]
#[must_use = "futures do nothing unless polled"]pub struct Sleep { /* fields omitted */ }
A Future
that does nothing and completes after the requested duration
Methods
impl Sleep
[src]
pub fn is_expired(&self) -> bool
[src]
Returns true if the Sleep
is expired.
A Sleep
is expired when the requested duration has elapsed. In
practice, the Sleep
can expire slightly before the requested duration
as the timer is not precise.
See the crate docs for more detail.
pub fn remaining(&self) -> Duration
[src]
Returns the duration remaining
pub fn timer(&self) -> &Timer
[src]
Returns a ref to the timer backing this Sleep
Trait Implementations
impl Debug for Sleep
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Future for Sleep
[src]
type Item = ()
A successful value
type Error = TimerError
An error
fn poll(&mut self, cx: &mut Context) -> Poll<(), TimerError>
[src]
Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more