Skip to main content

CalendarAlert

Struct CalendarAlert 

Source
#[non_exhaustive]
pub struct CalendarAlert { pub at_type: String, pub account_id: Id, pub calendar_event_id: Id, pub uid: String, pub recurrence_id: Option<String>, pub alert_id: String, pub extra: Map<String, Value>, }
Expand description

Push-notification payload emitted when a calendar alert fires (draft-ietf-jmap-calendars-33 §6.4).

Sent over the JMAP push channel when the server determines that an alert for a CalendarEvent should fire. Clients receiving this payload should trigger the appropriate local notification (e.g. an OS alert).

recurrenceId is null for non-recurring events and MUST serialize as null (not be omitted) — the receiver uses its presence to distinguish recurring from non-recurring.

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.
§at_type: String

Object type discriminator; always "CalendarAlert" on the wire.

Deserialize is liberal: if @type is absent (spec-violating vendor input), this field defaults to "CalendarAlert" rather than failing the whole parent object’s deserialize. Serialize always emits the field. See bd:JMAP-ky8g.10.

§account_id: Id

The account that owns the calendar event.

§calendar_event_id: Id

Id of the CalendarEvent for which this alert is firing.

§uid: String

The UID property of the iCalendar object underlying the calendar event.

§recurrence_id: Option<String>

The recurrenceId of the specific occurrence, or null for non-recurring events (draft-ietf-jmap-calendars-33 §6.4).

Serializes as null when None — intentionally NOT marked skip_serializing_if so the receiver can distinguish recurring from non-recurring events.

Maintainer note: do NOT add #[serde(skip_serializing_if = "Option::is_none")] to this field. Adding it would silently break the spec contract: per draft-ietf-jmap-calendars-33 §6.4, the receiver uses the presence of recurrenceId to determine whether the alert fired for a recurring or non-recurring event. An omitted field is indistinguishable from a sender that forgot to include it; an explicit null carries the “non-recurring” signal. This is the same “required-and-nullable” wire shape used by PrincipalCalendarsCapability.account_id in capability.rs:121.

A “clippy clean-up”, “consistency PR”, or pattern-based code audit may flag this field as inconsistent with neighbours that use skip_serializing_if and propose to “fix” it. That is a silent wire-protocol break. The regression test calendar_alert_recurrence_id_null_for_non_recurring (in tests/types_test.rs) pins the current behavior. Design defense: bd:JMAP-1rwf.7.

§alert_id: String

Id of the Alert object within the CalendarEvent that is firing.

§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).

Trait Implementations§

Source§

impl Clone for CalendarAlert

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 CalendarAlert

Source§

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

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

impl<'de> Deserialize<'de> for CalendarAlert

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 PartialEq for CalendarAlert

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 CalendarAlert

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 CalendarAlert

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.