can_socket

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

Implementors§