Skip to main content

JmapObject

Trait JmapObject 

Source
pub trait JmapObject:
    Serialize
    + for<'de> Deserialize<'de>
    + Send
    + Sync
    + 'static {
    type Property: Send + Sync + 'static;

    const TYPE_NAME: &'static str;
    const LOCALIZABLE: &'static [LocalizableProperty] = _;
}
Expand description

Marker trait for all JMAP object types.

Implement this in the types crate for each first-class JMAP object (e.g. Mailbox, Email, Chat). The TYPE_NAME constant is used in error messages and capability checks in the server crates.

Required Associated Constants§

Source

const TYPE_NAME: &'static str

The JMAP type name string (e.g. "Email", "Mailbox", "Chat").

Provided Associated Constants§

Source

const LOCALIZABLE: &'static [LocalizableProperty] = _

The localizable properties of this type (draft-atwood-jmap-updates-00 §5), as its defining specification lists them; empty, the default, for a type that has none.

A type with localizable properties gains locale and localizations and takes the language argument on /get, /query and /queryChanges when urn:ietf:params:jmap:i18n is in using; a type without them rejects language. See crate::i18n.

Required Associated Types§

Source

type Property: Send + Sync + 'static

The property selector enum for this type (server-side only, no serde).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl JmapObject for PushSubscription

PushSubscription has no property selector enum; PushSubscription/get takes property names directly.

Source§

const TYPE_NAME: &'static str = "PushSubscription"

Source§

type Property = ()