Trait diem_time_service::SleepTrait
source · pub trait SleepTrait: Future<Output = ()> + Send + Sync + Debug {
// Required methods
fn is_elapsed(&self) -> bool;
fn reset(self: Pin<&mut Self>, duration: Duration);
fn reset_until(self: Pin<&mut Self>, deadline: Instant);
}
Required Methods§
sourcefn is_elapsed(&self) -> bool
fn is_elapsed(&self) -> bool
Returns true
if this Sleep
’s requested wait duration has elapsed.
sourcefn reset(self: Pin<&mut Self>, duration: Duration)
fn reset(self: Pin<&mut Self>, duration: Duration)
Resets this Sleep
to wait again for duration
.
sourcefn reset_until(self: Pin<&mut Self>, deadline: Instant)
fn reset_until(self: Pin<&mut Self>, deadline: Instant)
Reset this Sleep
to wait again until the deadline
.