Skip to main content

handle_get

Function handle_get 

Source
pub async fn handle_get<O: GetObject, B: JmapBackend>(
    backend: &B,
    caller: &B::CallerCtx,
    args: Value,
) -> Result<HandlerOutput, JmapError>
Expand description

Generic */get handler (RFC 8620 §5.1).

Fetches objects by id (or all objects when ids is absent or null) and returns the standard get response shape. Returns the method-level requestTooLarge error when ids holds more entries than JmapAccounts::max_objects_in_get allows; a null ids is not counted.

It does not see the request’s using, so it treats urn:ietf:params:jmap:i18n as absent: a non-null language argument is invalidArguments, and locale/localizations are not returned for a type with JmapObject::LOCALIZABLE properties. Such types use handle_get_with_metadata.

§Errors

Method-level errors, returned as the JmapError:

  • invalidArguments if args is not an object or accountId is missing or not a valid Id. Also when ids or properties has the wrong shape, or language is non-null.
  • accountNotFound if the backend reports no such account; serverFail (with a redacted description) if that check fails.
  • requestTooLarge if ids exceeds the account’s maxObjectsInGet.
  • serverFail (redacted) if the backend fails to fetch the objects, or they do not serialize.