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§
Required Methods§
Sourcefn source_extent(&self) -> SourceExtent<Self::Cursor>
fn source_extent(&self) -> SourceExtent<Self::Cursor>
The earliest and current selectable cursors.
Sourcefn source_ticks(&self, max_points: usize) -> Vec<Self::Cursor>
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.
Sourcefn source_snapshot(&self, cursor: &Self::Cursor) -> Option<Self::Snapshot>
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".