#[non_exhaustive]pub struct AddressBook {
pub id: Id,
pub name: String,
pub description: Option<String>,
pub sort_order: u32,
pub is_default: bool,
pub is_subscribed: bool,
pub share_with: Option<HashMap<Id, AddressBookRights>>,
pub my_rights: AddressBookRights,
pub extra: Map<String, Value>,
}Expand description
A JMAP AddressBook object (RFC 9610 §2).
An AddressBook is a named collection of ContactCards. All ContactCards belong to one or more AddressBooks.
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: IdServer-assigned immutable identifier.
name: StringUser-visible name; MUST NOT be empty and MUST NOT exceed 255 UTF-8 octets.
description: Option<String>Optional longer-form description (default: null).
Required-and-nullable per RFC 9553 + RFC 9610 §4.1: always present on
the wire as "description": null when unset. Must NOT use
skip_serializing_if.
sort_order: u32UI sort order; lower values display first. Range: [0, 2^31). Defaults to 0 per RFC 9610 §2.
is_default: boolTrue for at most one AddressBook per account; server-set.
is_subscribed: boolTrue if the user has subscribed to this AddressBook.
Map of principal id → rights for principals this AddressBook is shared with.
Required-and-nullable (RFC 9610 §2 type: Id[AddressBookRights]|null):
always present in wire JSON; serializes as null when not shared.
The spec §4.1 example shows "shareWith": null explicitly — never absent.
my_rights: AddressBookRightsACL rights the authenticated user has on this AddressBook; server-set.
extra: Map<String, Value>Catch-all for vendor / site / private extension fields not covered by the typed fields above. Preserves unknown fields across deserialize/serialize round-trip per workspace extras-preservation policy (see workspace AGENTS.md).
See ContactCard::extra for the
collision contract: programmatically inserting a key that
matches a typed field name produces a duplicate JSON object key
on serialize. JMAP-glx8.19.
See AddressBook::validate_extras for a runtime pre-serialize
check that detects this hazard. JMAP-glx8.25.
Implementations§
Source§impl AddressBook
impl AddressBook
Sourcepub fn validate_extras(&self) -> Result<(), CollisionError>
pub fn validate_extras(&self) -> Result<(), CollisionError>
Check that no extra key shadows a typed
wire-format field of this struct. Returns
Err(CollisionError) listing any colliding
keys; otherwise returns Ok(()). See
ContactCard::validate_extras
for the design rationale. JMAP-glx8.25.
§Errors
Returns CollisionError when one or more keys in
extra match one of the camelCase wire-format
names of this struct’s typed fields.