Skip to main content

SourceTime

Trait SourceTime 

Source
pub trait SourceTime {
    type Cursor: Clone + Eq;
    type Snapshot;

    // Required methods
    fn source_extent(&self) -> SourceExtent<Self::Cursor>;
    fn source_ticks(&self, max_points: usize) -> Vec<Self::Cursor>;
    fn source_snapshot(&self, cursor: &Self::Cursor) -> Option<Self::Snapshot>;
}
Expand description

An ordered source of immutable snapshots.

This is intentionally storage- and clock-agnostic. A caller asks for a compact, stable set of cursors, selects one, then projects the returned snapshot with its existing arrangement. Selecting a historical cursor must not mutate the provider’s current truth.

Required Associated Types§

Source

type Cursor: Clone + Eq

An opaque source-owned identity for one snapshot.

Source

type Snapshot

The source’s truth at one cursor.

Required Methods§

Source

fn source_extent(&self) -> SourceExtent<Self::Cursor>

The earliest and current selectable cursors.

Source

fn source_ticks(&self, max_points: usize) -> Vec<Self::Cursor>

Evenly distributed, source-ordered cursors for a bounded scrubber.

max_points == 0 may return no cursors. Providers include both extent ends when they differ and more than one point is requested.

Source

fn source_snapshot(&self, cursor: &Self::Cursor) -> Option<Self::Snapshot>

Reproduce truth at exactly cursor, refusing stale or foreign cursors.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§