[][src]Trait myelin_engine::simulation::time::InstantWrapper

pub trait InstantWrapper: Debug {
    fn duration_since(&self, earlier: &dyn InstantWrapper) -> Duration;
fn elapsed(&self) -> Duration;
fn to_inner(&self) -> Instant; }

Wrapper for Instant, used to mock elapsed time

Required methods

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

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

Panics

This function will panic if earlier is later than self.

fn elapsed(&self) -> Duration

Returns the amount of time elapsed since this instant was created.

fn to_inner(&self) -> Instant

Retrieve the wrapped Instant

Loading content...

Implementors

impl InstantWrapper for InstantWrapperImpl[src]

Loading content...