Skip to main content

Module push_subscription

Module push_subscription 

Source
Expand description

JMAP PushSubscription/get and PushSubscription/set handlers.

Implements RFC 8620 §5.1: clients register a push endpoint URL; the server delivers a verification push, and thereafter fans out StateChange events to all verified subscriptions whose types list matches the changed data type.

§Registry architecture

The push registry lives in a OnceLock<Arc<PushState>> so the dispatch function (which has no state parameter) can access it without threading the handle through every call site. Call init_push_state once at server startup before dispatching any JMAP requests.

Structs§

PushState
Shared push state accessible from the stateless dispatch function.
PushSubscriptionCreate
Fields accepted when creating a new push subscription.
PushSubscriptionCreated
Minimal object returned for a newly created subscription.
PushSubscriptionGetRequest
PushSubscription/get request (RFC 8620 §5.1).
PushSubscriptionGetResponse
PushSubscription/get response.
PushSubscriptionSetRequest
PushSubscription/set request.
PushSubscriptionSetResponse
PushSubscription/set response.
PushSubscriptionUpdate
Fields that may be patched on an existing push subscription.
PushSubscriptionView
The RFC 8620 §5.1 view of a PushSubscription returned to the client.

Functions§

init_push_state
Install the global push state.
push_state
Retrieve the global push state, or None if it has not been initialised.
push_subscription_get
Handle PushSubscription/get.
push_subscription_set
Handle PushSubscription/set.
push_subscription_set_with_state
Testable variant of push_subscription_set that accepts an explicit PushState rather than reading from the OnceLock.

Type Aliases§

PushRegistry
Registry type alias.