dhcp_client_core::deps

Trait Instant

Source
pub trait Instant:
    Sized
    + Ord
    + Copy
    + Clone
    + Debug
    + Send
    + Sync {
    // Required methods
    fn add(&self, duration: Duration) -> Self;
    fn average(&self, other: Self) -> Self;
}
Expand description

A type representing an instant in time.

Required Methods§

Source

fn add(&self, duration: Duration) -> Self

Returns the time self + duration. Panics if self + duration would overflow the underlying instant storage type.

Source

fn average(&self, other: Self) -> Self

Returns the instant halfway between self and other.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Instant for MonotonicInstant

Source§

fn add(&self, duration: Duration) -> Self

Source§

fn average(&self, other: Self) -> Self

Implementors§