Skip to main content

TimeInstant

Trait TimeInstant 

Source
pub trait TimeInstant: Copy + PartialOrd {
    type Duration;

    // Required methods
    fn difference(&self, other: &Self) -> Self::Duration;
    fn add_duration(&self, duration: Self::Duration) -> Self;
}
Expand description

Provides arithmetic on Time<S> values via seconds duration.

Used by root-finding algorithms that bisect over a time interval.

Required Associated Types§

Source

type Duration

Duration type produced by subtracting two instants.

Required Methods§

Source

fn difference(&self, other: &Self) -> Self::Duration

Signed duration from other to self (self − other).

Source

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

Shift this instant forward by duration.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§