Skip to main content

PrincipalCalendarsCapability

Struct PrincipalCalendarsCapability 

Source
#[non_exhaustive]
pub struct PrincipalCalendarsCapability { pub account_id: Option<Id>, pub may_get_availability: bool, pub may_share_with: bool, pub calendar_address: Option<String>, }
Expand description

The value of Principal.capabilities["urn:ietf:params:jmap:calendars"] on a JMAP Principals object (draft-ietf-jmap-calendars-33 §2.1).

This is distinct from the session-level CalendarsCapability. Where CalendarsCapability appears in the JMAP Session capabilities map, PrincipalCalendarsCapability appears inside a Principal object’s own capabilities map and describes that principal’s calendar presence.

§Field semantics

  • account_id — the JMAP account id that contains this principal’s calendar data, or null if the principal has no calendar account accessible to the requesting user.
  • may_get_availability — the requesting user may call Principal/getAvailability for this principal.
  • may_share_with — the requesting user may add this principal to the shareWith of their own Calendar objects.
  • calendar_address — the iTIP scheduling address for this principal (e.g. "mailto:alice@example.com"), or null if the principal may not be added as a participant to an event.

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.
§account_id: Option<Id>

Id of the account containing this principal’s calendar data, or null if no accessible calendar account exists.

Required-and-nullable: always present on the wire, as null or an Id. Do NOT add skip_serializing_if to this field: draft-ietf-jmap-calendars §2.1 types accountId as Id|null, so omitting it on None is a wire-protocol break, not a clean-up. The regression test principal_calendars_capability_account_id_null_serializes (in tests/types_test.rs) pins the current behavior. Precedent: CalendarAlert.recurrence_id, bd:JMAP-1rwf.7.

§may_get_availability: bool

The requesting user may call Principal/getAvailability for this principal.

§may_share_with: bool

The requesting user may add this principal to the shareWith property of their own Calendar objects.

§calendar_address: Option<String>

iTIP scheduling address for this principal, or null when it may not be added as a participant (draft-ietf-jmap-calendars-33 §2.1: “calendarAddress: String|null … otherwise, this is null”).

Required-and-nullable: always present on the wire, as null or a String.

Trait Implementations§

Source§

impl Clone for PrincipalCalendarsCapability

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 PrincipalCalendarsCapability

Source§

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

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

impl<'de> Deserialize<'de> for PrincipalCalendarsCapability

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 PrincipalCalendarsCapability

Source§

impl PartialEq for PrincipalCalendarsCapability

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 PrincipalCalendarsCapability

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 PrincipalCalendarsCapability

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.