Expand description
Backend-agnostic JMAP server framework (RFC 8620).
Provides request parsing, ResultReference resolution, HTTP response helpers,
the Dispatcher machinery, shared backend infrastructure, and generic
JMAP method handlers.
Re-exports§
pub use backend::AddedItem;pub use backend::BackendChangesError;pub use backend::ChangesResult;pub use backend::JmapBackend;pub use backend::QueryChangesResult;pub use backend::QueryResult;pub use handlers::handle_changes;pub use handlers::handle_get;pub use handlers::handle_query;pub use handlers::handle_query_changes;
Modules§
- backend
- Shared backend infrastructure for all JMAP server crates.
- handlers
- Generic JMAP method handlers shared across all server crates.
Structs§
- Dispatcher
- Dispatches a
JmapRequestto registered method handlers. - Id
- Opaque non-empty server-assigned identifier (RFC 8620 §1.2).
- Jmap
Error - JMAP method-level error, serializable for inclusion in
methodResponses. - Jmap
Request - JMAP request envelope (RFC 8620 §3.3).
- Jmap
Response - JMAP response envelope (RFC 8620 §3.4).
- Request
Error - A request-level JMAP error response: HTTP status code + JMAP error body.
- Result
Reference - A reference to the result of a previous invocation in the same JMAP request batch. Used in method arguments with a “#” prefix on the JSON key (RFC 8620 §9).
- State
- Opaque server state token (RFC 8620 §1.2).
- UTCDate
- RFC 3339 UTC timestamp string (RFC 8620 §1.4).
Enums§
- Argument
- A JMAP method argument that can be either a direct value or a ResultReference.
Traits§
- GetObject
- Marker for object types that support
getandchangesoperations. - Jmap
Handler - Implement this for each JMAP method handler.
- Jmap
Object - Marker trait for all JMAP object types.
- Query
Object - Marker for object types that support
queryandqueryChangesoperations. - SetObject
- Marker for object types that support
set(create/update/destroy) operations.
Functions§
- error_
invocation - Wrap a method-level error as an error
InvocationformethodResponses. - error_
status - Map a
JmapErrortype string to the appropriate HTTP status code. - extract_
account_ id - Extract
accountIdfrom a JMAP method arguments object. - not_
found_ json - Convert a slice of
Ids to a JSONnotFoundvalue. - now_
utc_ string - Return the current UTC instant formatted as an RFC 3339 string.
- parse_
request - Parse and validate a JMAP request from a raw JSON value.
- request_
error - Convenience constructor: wrap a
JmapErrorin aRequestError, deriving the HTTP status code automatically. - resolve_
args - Resolve all
#keyResultReference fields inargsagainstprior_responses. - ser
- Serialize any
serde::Serializetype to aserde_json::Value, mapping serialization errors toJmapError::server_fail.
Type Aliases§
- Handler
Future - The return type for all
JmapHandlerimplementations. - Invocation
- A JMAP method invocation:
[method_name, arguments, call_id].