Trait Deadline

Source
pub trait Deadline {
    // Required method
    fn deadline(&self) -> Instant;
}
Expand description

Trait for types that can be used as a timeout or deadline.

Required Methods§

Source

fn deadline(&self) -> Instant

Get the instant at which the timeout/deadline expires.

Implementations on Foreign Types§

Source§

impl Deadline for Duration

Source§

fn deadline(&self) -> Instant

Get the instant at which the timeout/deadline expires.

If the "tokio" feature is enabled, this uses tokio::time::Instant to compute the deadline. This means that tokio::time::pause() and tokio::time::advance() will work as expected.

Source§

impl Deadline for Instant

Source§

impl Deadline for Instant

Implementors§