pub async fn handle_query<O: QueryObject, B: JmapBackend>(
backend: &B,
caller: &B::CallerCtx,
args: Value,
) -> Result<HandlerOutput, JmapError>Expand description
Generic */query handler (RFC 8620 §5.5).
Parses filter and sort from args as O::Filter and O::Comparator, and
anchor/anchorOffset via query_anchor_args, then delegates to
JmapReads::query_objects. A
BackendQueryError::Method
is returned to the client unchanged; any other backend error becomes the
redacted serverFail.
Like handle_get it does not see using, so a non-null language
(draft-atwood-jmap-updates-00 §4.2) is invalidArguments. A type with
JmapObject::LOCALIZABLE properties
uses handle_query_with_i18n or its own handler.
§Errors
Method-level errors, returned as the JmapError:
invalidArgumentsifargsis not an object oraccountIdis missing or not a valid Id. Also whenfilteris not an object,sortis not an array of comparators,anchororanchorOffsetis malformed,positionorlimithas the wrong type, orlanguageis non-null.accountNotFoundif the backend reports no such account;serverFail(with a redacted description) if that check fails.unsupportedFilteriffilteris an object that does not decode as the type’s filter.- A
BackendQueryError::Methodfrom the backend unchanged (for exampleunsupportedSortoranchorNotFound); any other backend error becomes the redactedserverFail.