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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Instant for Time

source§

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

source§

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

Implementors§