pub fn as_of_query<T>(
records: &[BitemporalRecord<T>],
valid_time: DateTime<Utc>,
recorded_time: DateTime<Utc>,
) -> Vec<BitemporalRecord<T>>where
T: Clone,Expand description
Query records valid at a specific valid_time as of a specific recorded_time.
This implements the bitemporal “as-of” query:
- Returns records whose
valid_timeis at or before the queryvalid_time - Among those, returns the version that was current as of
recorded_time(i.e., the latest record withrecorded_time <= query_recorded_time)
§Arguments
records— slice of all records (simulating a database table)valid_time— the business time to queryrecorded_time— the system time to query as-of
§Returns
Records valid at valid_time as of recorded_time.