#[non_exhaustive]pub enum Metadata {
Annotation(Annotation),
ImapMetadata(ImapMetadata),
WebDavMetadata(WebDavMetadata),
}Expand description
A JMAP Metadata object (draft-ietf-jmap-metadata-01 §2).
The spec defines three concrete object types — Annotation,
ImapMetadata, and WebDavMetadata — all discriminated by the
@type property. This enum is serialised with @type as the internal
tag, matching the wire format defined by §2.1.
Additional metadata types MAY be defined by future specifications
(§2.1). Such future types will require new variants on this enum; the
#[non_exhaustive] derive keeps that non-breaking.
§Wire-format examples
{ "@type": "Annotation", "id": "MD1", "relatedType": "Mailbox",
"relatedId": "MB1", "isPrivate": true,
"acme.example.com:color": "blue" }
{ "@type": "ImapMetadata", "id": "MD2", "relatedType": "Mailbox",
"relatedId": "MB1", "isPrivate": false,
"metadata": { "comment": "Team mailbox" } }
{ "@type": "WebDavMetadata", "id": "MD3", "relatedType": "FileNode",
"relatedId": "F1", "isPrivate": false,
"metadata": { "{DAV:}displayname": "Project Documents" } }Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Annotation(Annotation)
General-purpose vendor metadata (draft-ietf-jmap-metadata-01 §2.1.1).
ImapMetadata(ImapMetadata)
IMAP RFC 5464 mapping (draft-ietf-jmap-metadata-01 §2.1.2).
WebDavMetadata(WebDavMetadata)
WebDAV RFC 4918 dead-property mapping (draft-ietf-jmap-metadata-01 §2.1.3).
Implementations§
Source§impl Metadata
impl Metadata
Return the relatedType property common to every Metadata variant.
Return the relatedId property common to every Metadata variant.
Sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Return the isPrivate property common to every Metadata variant
(defaulting to false per §2.2.1.5 when the inner field is None).