Skip to main content

AddressBookRights

Struct AddressBookRights 

Source
#[non_exhaustive]
pub struct AddressBookRights { pub may_read: bool, pub may_write: bool, pub may_share: bool, pub may_delete: bool, pub may_set_metadata: Option<bool>, pub extra: Map<String, Value>, }
Expand description

Access rights a principal holds on an AddressBook (RFC 9610 §2).

All four rights are booleans. Default produces all-false, which is the most restrictive valid value and a safe starting point when constructing rights in tests or server code.

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.
§may_read: bool

User may fetch the ContactCards in this AddressBook.

§may_write: bool

User may create, modify, or destroy all ContactCards in this AddressBook, or move them to or from this AddressBook.

§may_share: bool

User may modify the shareWith property for this AddressBook.

§may_delete: bool

User may delete the AddressBook itself.

§may_set_metadata: Option<bool>

User may modify the shared metadata of this AddressBook and of the ContactCards in it (draft-ietf-jmap-metadata-04 §4.1). None when the server omits it: the right is present only when the metadata capability lists this type or a type it contains (§4.1).

§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. Treat extra as a write-only catch-all for unknown keys discovered at deserialize. JMAP-glx8.19.

See AddressBookRights::validate_extras for a runtime pre-serialize check that detects this hazard. JMAP-glx8.25.

Implementations§

Source§

impl AddressBookRights

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 AddressBookRights

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 AddressBookRights

Source§

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

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

impl Default for AddressBookRights

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for AddressBookRights

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 Eq for AddressBookRights

Source§

impl PartialEq for AddressBookRights

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 AddressBookRights

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 StructuralPartialEq for AddressBookRights

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.