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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Deadline for Duration
impl Deadline for Duration
Source§fn deadline(&self) -> Instant
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.