dhcpv6_core

Trait Instant

Source
pub trait Instant:
    Sized
    + Ord
    + Copy
    + Clone
    + Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn duration_since(&self, earlier: Self) -> Duration;
    fn checked_add(&self, duration: Duration) -> Option<Self>;
}
Expand description

A type representing an instant in time.

Required Methods§

Source

fn duration_since(&self, earlier: Self) -> Duration

Returns the amount of time elapsed from another instant to this one.

§Panics

This function will panic if earlier is later than self.

Source

fn checked_add(&self, duration: Duration) -> Option<Self>

Returns Some(t) where t is the time self + duration if t can be represented as Instant (which means it’s inside the bounds of the underlying data structure), None otherwise.

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 Instant

Source§

fn duration_since(&self, earlier: Self) -> Duration

Source§

fn checked_add(&self, duration: Duration) -> Option<Self>

Implementors§