pub enum TimestampResolution {
Offset(Offset),
BeforeRetentionHorizon {
horizon_ns: i64,
},
LogEmpty,
}Expand description
Outcome returned by a timestamp→offset resolver.
v0.6.0 Tier 2 #6 — a resolver that owns its own index (the
runtime’s in-memory timestamp index, an audit-log-backed index,
etc.) can distinguish three cases that Option<Offset> cannot:
- We found an offset at or before the requested timestamp.
- The log has entries, but the earliest is after the requested
timestamp — i.e. the request predates the retention horizon.
Surfacing this as a distinct variant lets the query layer emit
QueryError::AsOfBeforeRetentionHorizonwith the horizon attached, which is far more actionable to the caller. - The log is empty — no timestamps recorded yet.
See QueryEngine::query_at_timestamp_resolved for the
consumer of this type.
Variants§
Offset(Offset)
Resolver found a projection offset whose commit timestamp is the greatest value ≤ the target.
BeforeRetentionHorizon
Resolver has entries, but the earliest commit timestamp is
strictly greater than the target. horizon_ns is that
earliest timestamp, so callers can tell users “the oldest
retained data is <horizon>, try a later instant”.
LogEmpty
Resolver has no entries at all (fresh DB or the index hasn’t
been seeded yet). Indistinguishable from “predates genesis”
in observable behaviour — surfaced via UnsupportedFeature.
Trait Implementations§
Source§impl Clone for TimestampResolution
impl Clone for TimestampResolution
Source§fn clone(&self) -> TimestampResolution
fn clone(&self) -> TimestampResolution
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more