Skip to main content

ceiling_resolve_cell

Function ceiling_resolve_cell 

Source
pub fn ceiling_resolve_cell<'a, I>(
    tile_versions_newest_first: I,
    _coord: &[CoordValue],
    params: &CeilingParams,
) -> ArrayResult<CeilingResult>
where I: IntoIterator<Item = (TileId, &'a [u8])>,
Expand description

Resolve the Ceiling for a single cell coordinate.

tile_versions_newest_first(TileId, raw_cell_bytes) pairs ordered newest-first by system_from_ms. The caller is responsible for the ordering; this function additionally defends against misuse with a guard that skips entries where tile_id.system_from_ms > params.system_as_of.

For each version the function applies:

  1. System-time guard: skip if tile_id.system_from_ms > system_as_of.
  2. Sentinel check: tombstone → Tombstoned; GDPR erasure → Erased.
  3. Valid-time filter (when valid_at_ms is Some): if the decoded payload’s valid-time interval does not contain vt, continue to the next older version.
  4. Return Live(payload).

If the iterator is exhausted without a match, returns NotFound.