Skip to main content

resolve_query_start

Function resolve_query_start 

Source
pub fn resolve_query_start(
    ids: &[Id],
    position: i64,
    anchor: Option<&Id>,
    anchor_offset: i64,
) -> Result<usize, JmapError>
Expand description

Start index of a /query page within the filtered, sorted ids (RFC 8620 §5.5), for JmapBackend::query_objects implementations.

With an anchor, position is ignored and the start is the anchor’s index plus anchor_offset, clamped to 0..=ids.len(). Without one, anchor_offset is ignored and the start is resolve_query_offset(position, ids.len()).

§Errors

JmapError::anchor_not_found when anchor is not in ids.