Skip to main content

Source

Trait Source 

Source
pub trait Source: Sized {
    // Required method
    fn read(&self) -> Result<Unix<Nanos>, Error>;

    // Provided methods
    fn sample(&self) -> Result<(Unix<Nanos>, Instant), Error> { ... }
    fn anchor<'d>(&self, witness: &Moment<'d>) -> Result<Anchor<'d>, Error> { ... }
}
Expand description

Statically dispatched source of absolute civil time.

Required Methods§

Source

fn read(&self) -> Result<Unix<Nanos>, Error>

Provided Methods§

Source

fn sample(&self) -> Result<(Unix<Nanos>, Instant), Error>

Pairs civil time with the monotonic sample immediately preceding its read. The clocks are sampled sequentially; their skew is confined to acquisition. Injected sources can supply the exact corresponding pair instead.

Source

fn anchor<'d>(&self, witness: &Moment<'d>) -> Result<Anchor<'d>, Error>

Projects one fresh sample back to this admitted driver turn. Retaining the turn origin keeps observations in the same turn valid without counting time spent before acquisition twice in subsequent turns.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§