Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

AsOf semantics — bitemporal point

Every query reads facts at a specific bitemporal point. The AsOf type carries both axes:

#![allow(unused)]
fn main() {
pub enum AsOf {
    /// Default: VT = now, TT = now — "what is currently true, as currently believed."
    Now,
    /// "What was valid at VT = t, as currently believed?" Historical-fact view.
    AtVt(DateTime),
    /// "What was believed at TT = t about VT = now?" Audit view.
    AtTt(DateTime),
    /// Full bitemporal: "what was believed at TT = tt about VT = vt?"
    At { vt: DateTime, tt: DateTime },
}
}

The default AsOf::Now answers about current state; historical and audit queries are opt-in.

Forks interact with AsOf through the copy-on-write invariant. A child fork inherits parent state up to fork_point_tt. A query against the child at AsOf::AtTt(tt): if tt < fork_point_tt it reads the parent’s events at tt; if tt ≥ fork_point_tt it reads the parent’s pre-fork events plus the child’s own events up to tt. The parent’s pre-fork state is shared with all children; each child sees its own divergence. A backend MAY materialize the inheritance at fork-creation or compute it lazily on read; both satisfy the contract.