Skip to main content

AddressBook

Struct AddressBook 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§id: Id

Server-assigned immutable identifier.

§name: String

User-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: u32

UI sort order; lower values display first. Range: [0, 2^31). Defaults to 0 per RFC 9610 §2.

§is_default: bool

True for at most one AddressBook per account; server-set.

§is_subscribed: bool

True if the user has subscribed to this AddressBook.

§share_with: Option<HashMap<Id, AddressBookRights>>

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: AddressBookRights

ACL 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

Source

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.

Trait Implementations§

Source§

impl Clone for AddressBook

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AddressBook

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AddressBook

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl GetObject for AddressBook

Source§

impl JmapObject for AddressBook

Source§

const TYPE_NAME: &'static str = "AddressBook"

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

type Property = AddressBookProperty

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

impl PartialEq for AddressBook

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for AddressBook

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl SetObject for AddressBook

Source§

type Patch = PatchObject

The patch type for update operations. Read more
Source§

impl StructuralPartialEq for AddressBook

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.