Skip to main content

Deadline

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.

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

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

Available on crate feature tokio only.

Implementors§