pub struct Deadline { /* private fields */ }Expand description
Cloneable monotonic deadline visible to cooperative worker code.
Loader-owned deadlines are armed for each blocking Iterator::next call
and disarmed afterwards. Deadline::none never expires.
Implementations§
Source§impl Deadline
impl Deadline
Sourcepub fn after(timeout: Duration) -> Self
pub fn after(timeout: Duration) -> Self
Creates a deadline expiring after timeout.
A duration outside the platform’s monotonic Instant range fails
closed as an already-expired deadline; it never becomes unarmed.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Returns whether the armed deadline has expired.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Deadline
impl Freeze for Deadline
impl RefUnwindSafe for Deadline
impl Send for Deadline
impl Sync for Deadline
impl Unpin for Deadline
impl UnsafeUnpin for Deadline
impl UnwindSafe for Deadline
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