#[non_exhaustive]pub struct Annotation {
pub id: Option<Id>,
pub related_type: String,
pub related_id: Id,
pub is_private: Option<bool>,
pub extra: Map<String, Value>,
}Expand description
General-purpose vendor metadata (draft-ietf-jmap-metadata-01 §2.1.1).
The @type wire value is "Annotation"; it is supplied by the enclosing
Metadata tag and does NOT appear as a field on this struct.
§Vendor-specific properties (§2.2.1.6)
Annotations are designed to carry arbitrary vendor-defined properties
beyond the common fields below. Vendor properties MUST be prefixed with a
domain name owned by the vendor, e.g. acme.example.com:color. Those
fields are captured in extra and round-trip
losslessly per the workspace extras-preservation policy.
§id is server-set
On Metadata/set create operations the client omits id; the server
assigns it. id is Option<Id> so client-side request construction is
natural.
§isPrivate default
Per §2.2.1.5 the default is false. The field is Option<bool> so
callers can distinguish “explicitly false on the wire” from “absent”.
Wire-omitted defaults to shared.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: Option<Id>Server-assigned identifier. Absent on create requests.
JMAP type name of the related object (e.g. "Email", "Mailbox").
Mandatory per §2.2.1.3.
Identifier of the related JMAP object. Mandatory per §2.2.1.4.
is_private: Option<bool>Whether this annotation is private to the authenticated user.
Default false per §2.2.1.5.
extra: Map<String, Value>Vendor-specific properties (§2.2.1.6) and any other extension fields not covered by the typed fields above.
Captures every JSON key on the wire that is not @type, id,
relatedType, relatedId, or isPrivate. Vendor properties are
domain-prefixed strings (e.g. acme.example.com:color) per the
spec’s naming requirement.
Round-trips losslessly per the workspace extras-preservation policy
(see workspace AGENTS.md). Empty-map case serialises to nothing,
preserving wire-byte identity with the spec examples.
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Annotation
impl Debug for Annotation
Source§impl<'de> Deserialize<'de> for Annotation
impl<'de> Deserialize<'de> for Annotation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for Annotation
impl PartialEq for Annotation
Source§fn eq(&self, other: &Annotation) -> bool
fn eq(&self, other: &Annotation) -> bool
self and other values to be equal, and is used by ==.