Skip to main content

Crate jmap_tasks_server

Crate jmap_tasks_server 

Source
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§

AddedItem
One entry in the added array of a QueryChangesResult: a typed (index, id) pair. One entry in the added list of a /queryChanges response (RFC 8620 §5.6).
ChangesResult
Result of JmapBackend::get_changes (RFC 8620 §5.2). Carries created, updated, destroyed, the hasMoreChanges flag, and the new state token. Result of a /changes call (RFC 8620 §5.2).
ClosureHandler
Handler-wrapper type for registering custom JMAP method handlers on a jmap_server::Dispatcher without writing a full JmapHandler impl from scratch. Most consumers should NOT need this — the register_tasks_handlers function above registers all 14 method names automatically. Reach for ClosureHandler only when extending the dispatcher with site-specific JMAP methods that are not part of the standard Tasks surface. Generic closure-to-JmapHandler adapter from jmap_server.
QueryChangesResult
Result of JmapBackend::query_changes (RFC 8620 §5.6). Carries added, removed, optional total count, and the new state. Result of a /queryChanges call (RFC 8620 §5.6).
QueryResult
Result of JmapBackend::query_objects (RFC 8620 §5.5). Carries the id list, anchor position, total count (when requested), and state. Result of a /query call (RFC 8620 §5.5).
SetError
JMAP wire-format SetError; emitted by TasksBackend write methods wrapped as BackendSetError::SetError and serialised into notCreated / notUpdated / notDestroyed maps by the /set handlers (RFC 8620 §5.3). A per-item error in a /set response (notCreated, notUpdated, notDestroyed maps) (RFC 8620 §5.3).

Enums§

BackendChangesError
Backend-side error wrapper for /changes paths (RFC 8620 §5.2); distinguished from BackendSetError because the cannotCalculateChanges recovery is a /changes-specific contract. Error type returned by JmapBackend::get_changes and JmapBackend::query_changes.
BackendSetError
Backend-side wrapper around SetError; the trait’s write methods return Result<…, BackendSetError<Self::Error>>. The handler unwraps BackendSetError::SetError into the per-target SetError map and folds BackendSetError::Other(e) into a top-level serverFail. Error type returned by create/update/destroy backend methods.
SetErrorType
The standard wire-format SetError type tag (RFC 8620 §5.3 + extension-specific types like taskListHasTask from draft-ietf-jmap-tasks-06 §3.4). The machine-readable type for a SetError (RFC 8620 §5.3 and RFC 8621).
TaskListProperty
TaskList property selector enum (draft-ietf-jmap-tasks-06 §3); used in JmapBackend::get_objects::<TaskList> property projection. Property selector for crate::TaskList /get and /set.
TaskNotificationProperty
TaskNotification property selector enum (draft-ietf-jmap-tasks-06 §5). Property selector for crate::TaskNotification /get.
TaskProperty
Task property selector enum (draft-ietf-jmap-tasks-06 §4); used in JmapBackend::get_objects::<Task> property projection. Property selector for crate::Task /get and /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 support get and changes operations.
JmapBackend
Foundation JmapBackend supertrait. TasksBackend extends this with Task-specific methods; consumers must implement both. Read-side backend supertrait shared by all JMAP server crates.
JmapObject
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.
QueryObject
Marker trait identifying a “queryable” JMAP object type. Adds the Filter and Comparator associated types on top of JmapObject. Marker for object types that support query and queryChanges operations.
SetObject
Marker trait identifying a “settable” JMAP object type. Adds the Patch associated type on top of JmapObject. Marker for object types that support set (create/update/destroy) operations.

Functions§

register_tasks_handlers
Register all JMAP Tasks method handlers with dispatcher.