Expand description
JMAP Tasks extension method handlers (draft-ietf-jmap-tasks-06).
§Usage
Implement TasksBackend for your storage layer, then call
register_tasks_handlers to wire all method names into a
jmap_server::Dispatcher:
let mut dispatcher: Dispatcher<()> = Dispatcher::new();
register_tasks_handlers(&mut dispatcher, Arc::new(backend));§memory feature (reference implementation)
Enable the memory feature to expose the memory::MemoryBackend
reference implementation of TasksBackend. This is the same backend
used by this crate’s own integration tests, intended for downstream
contributors to study and for smoke tests / examples that do not want
to stand up a real database. Not production. API stability is
opt-in via this feature and may break across minor versions while the
crate is pre-1.0.
Re-exports§
pub use backend::TasksBackend;pub use task::handle_task_changes;pub use task::handle_task_copy;pub use task::handle_task_get;pub use task::handle_task_query;pub use task::handle_task_query_changes;pub use task::handle_task_set;pub use task_list::handle_task_list_changes;pub use task_list::handle_task_list_get;pub use task_list::handle_task_list_set;pub use task_notification::handle_task_notification_changes;pub use task_notification::handle_task_notification_get;pub use task_notification::handle_task_notification_query;pub use task_notification::handle_task_notification_query_changes;pub use task_notification::handle_task_notification_set;
Modules§
- backend
- TasksBackend trait and supporting types for JMAP Tasks method handlers.
- task
- Task/* method handlers (draft-tasks-06 §4).
- task_
list - TaskList/* method handlers (draft-tasks-06 §3).
- task_
notification - TaskNotification/* method handlers (draft-tasks-06 §5).
Structs§
- Added
Item - One entry in the
addedarray of aQueryChangesResult: a typed(index, id)pair. One entry in theaddedlist of a/queryChangesresponse (RFC 8620 §5.6). - Changes
Result - Result of
JmapBackend::get_changes(RFC 8620 §5.2). Carriescreated,updated,destroyed, thehasMoreChangesflag, and the new state token. Result of a/changescall (RFC 8620 §5.2). - Closure
Handler - Handler-wrapper type for registering custom JMAP method handlers on a
jmap_server::Dispatcherwithout writing a fullJmapHandlerimpl from scratch. Most consumers should NOT need this — theregister_tasks_handlersfunction above registers all 14 method names automatically. Reach forClosureHandleronly when extending the dispatcher with site-specific JMAP methods that are not part of the standard Tasks surface. Generic closure-to-JmapHandleradapter fromjmap_server. - Query
Changes Result - Result of
JmapBackend::query_changes(RFC 8620 §5.6). Carriesadded,removed, optional total count, and the new state. Result of a/queryChangescall (RFC 8620 §5.6). - Query
Result - Result of
JmapBackend::query_objects(RFC 8620 §5.5). Carries the id list, anchor position, total count (when requested), and state. Result of a/querycall (RFC 8620 §5.5). - SetError
- JMAP wire-format SetError; emitted by
TasksBackendwrite methods wrapped asBackendSetError::SetErrorand serialised intonotCreated/notUpdated/notDestroyedmaps by the/sethandlers (RFC 8620 §5.3). A per-item error in a/setresponse (notCreated,notUpdated,notDestroyedmaps) (RFC 8620 §5.3).
Enums§
- Backend
Changes Error - Backend-side error wrapper for
/changespaths (RFC 8620 §5.2); distinguished fromBackendSetErrorbecause thecannotCalculateChangesrecovery is a/changes-specific contract. Error type returned byJmapBackend::get_changesandJmapBackend::query_changes. - Backend
SetError - Backend-side wrapper around
SetError; the trait’s write methods returnResult<…, BackendSetError<Self::Error>>. The handler unwrapsBackendSetError::SetErrorinto the per-target SetError map and foldsBackendSetError::Other(e)into a top-levelserverFail. Error type returned by create/update/destroy backend methods. - SetError
Type - The standard wire-format SetError type tag (RFC 8620 §5.3 +
extension-specific types like
taskListHasTaskfrom draft-ietf-jmap-tasks-06 §3.4). The machine-readable type for aSetError(RFC 8620 §5.3 and RFC 8621). - Task
List Property TaskListproperty selector enum (draft-ietf-jmap-tasks-06 §3); used inJmapBackend::get_objects::<TaskList>property projection. Property selector forcrate::TaskList/getand/set.- Task
Notification Property TaskNotificationproperty selector enum (draft-ietf-jmap-tasks-06 §5). Property selector forcrate::TaskNotification/get.- Task
Property Taskproperty selector enum (draft-ietf-jmap-tasks-06 §4); used inJmapBackend::get_objects::<Task>property projection. Property selector forcrate::Task/getand/set.
Constants§
- JMAP_
TASKS_ URI - Capability URI for
urn:ietf:params:jmap:tasks. Capability URI for core JMAP Tasks support (draft-tasks-06 §1.6.1).
Traits§
- GetObject
- Marker trait identifying a “gettable” JMAP object type. Adds the
property-projection contract on top of
JmapObject. Marker for object types that supportgetandchangesoperations. - Jmap
Backend - Foundation
JmapBackendsupertrait.TasksBackendextends this with Task-specific methods; consumers must implement both. Read-side backend supertrait shared by all JMAP server crates. - Jmap
Object - Marker trait identifying a JMAP object type (RFC 8620 §5). Used as a
bound on
get_state/get_changes/query_objects. Marker trait for all JMAP object types. - Query
Object - Marker trait identifying a “queryable” JMAP object type. Adds the
FilterandComparatorassociated types on top ofJmapObject. Marker for object types that supportqueryandqueryChangesoperations. - SetObject
- Marker trait identifying a “settable” JMAP object type. Adds the
Patchassociated type on top ofJmapObject. Marker for object types that supportset(create/update/destroy) operations.
Functions§
- register_
tasks_ handlers - Register all JMAP Tasks method handlers with
dispatcher.