#[non_exhaustive]pub struct Calendar {Show 17 fields
pub id: Option<Id>,
pub name: String,
pub description: Option<String>,
pub color: Option<String>,
pub sort_order: u32,
pub is_subscribed: bool,
pub is_visible: bool,
pub is_default: bool,
pub include_in_availability: IncludeInAvailability,
pub default_alerts_with_time: Option<BTreeMap<Id, Value>>,
pub default_alerts_without_time: Option<BTreeMap<Id, Value>>,
pub time_zone: Option<String>,
pub share_with: Option<BTreeMap<Id, CalendarRights>>,
pub my_rights: CalendarRights,
pub metadata: Option<Map<String, Value>>,
pub private_metadata: Option<Map<String, Value>>,
pub extra: Map<String, Value>,
}Expand description
A JMAP Calendar object (draft-ietf-jmap-calendars-33 §4).
A Calendar is a named collection of CalendarEvents. All events are
associated with at least one calendar. The id is immutable and
server-set.
§Nullable vs. absent fields
Per RFC 8620 §5.1, a field may be absent from a response when the
properties argument was used to request a subset. Fields that the
spec defines as nullable (e.g. description, color, share_with)
use Option<T> without skip_serializing_if so that null round-
trips correctly. Fields that are simply optional in the request context
use Option<T> with skip_serializing_if = "Option::is_none".
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: Option<Id>Server-assigned immutable identifier.
Option<Id> with skip_serializing_if so /set create payloads
constructed by a typed caller do NOT emit a client-supplied id
on the wire. Per RFC 8620 §5.3, the id property MUST NOT be set
in the create object — the server assigns it. Matches the
in-crate sibling CalendarEvent.id (event.rs:43-44).
name: StringUser-visible name for this calendar (1–255 UTF-8 octets).
description: Option<String>Optional longer-form description; null if not set.
color: Option<String>CSS color name or #rrggbb; null if not set.
sort_order: u32Client UI sort position; lower values sort first (0 ≤ n < 2^31).
is_subscribed: boolWhether the user has subscribed to this calendar.
is_visible: boolWhether to display this calendar’s events (ignored if not subscribed).
is_default: boolServer-set; true for at most one calendar per account.
include_in_availability: IncludeInAvailabilityWhich events in this calendar contribute to availability calculations.
default_alerts_with_time: Option<BTreeMap<Id, Value>>Default alerts for timed events when useDefaultAlerts is true.
Id[Alert] (draft-ietf-jmap-calendars-33 §4): keys are alert ids;
values are Alert objects (RFC 8984 §4.5.2).
Complex sub-objects passed through as opaque JSON.
default_alerts_without_time: Option<BTreeMap<Id, Value>>Default alerts for all-day events when useDefaultAlerts is true.
Id[Alert] (draft-ietf-jmap-calendars-33 §4): keys are alert ids;
values are Alert objects (RFC 8984 §4.5.2).
time_zone: Option<String>IANA Time Zone Database id; null to inherit from the account Principal.
This crate does not check the value against the IANA Time Zone Database; validating the zone name is the backend’s job.
Map of Principal id → rights; null if not shared.
May only be modified by a user with may_share right.
my_rights: CalendarRightsAccess rights the authenticated user holds for this calendar (server-set).
metadata: Option<Map<String, Value>>Shared metadata, keyed by namespace identifier
(draft-ietf-jmap-metadata-04 §2). Each value is a JSON object (§2.1).
None when absent, which -04 §2 treats as {}; in an update a
null value “is equivalent to {}” (-04 §3.2) and also decodes as
None.
private_metadata: Option<Map<String, Value>>The authenticated user’s own metadata, keyed by namespace
identifier (draft-ietf-jmap-metadata-04 §2). Same shape and None
handling as metadata.
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<'de> Deserialize<'de> for Calendar
impl<'de> Deserialize<'de> for Calendar
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl GetObject for Calendar
Source§impl JmapObject for Calendar
impl JmapObject for Calendar
Source§impl SetObject for Calendar
draft-ietf-jmap-calendars-33 §4 (lines 747, 816, 907): id is
“(immutable; server-set)”; isDefault and myRights are
“(server-set)”.
impl SetObject for Calendar
draft-ietf-jmap-calendars-33 §4 (lines 747, 816, 907): id is
“(immutable; server-set)”; isDefault and myRights are
“(server-set)”.
draft-ietf-jmap-metadata-04 §3.2: clients write metadata and
privateMetadata through Foo/set.
Source§const SERVER_SET: &'static [&'static str]
const SERVER_SET: &'static [&'static str]
/set method text never accepts from a
client, on create or update, is server-set too. Read moreSource§const CLIENT_SETTABLE: &'static [&'static str]
const CLIENT_SETTABLE: &'static [&'static str]
SERVER_SET: the ones a
client may set through /set. Read moreSource§const IMMUTABLE: &'static [&'static str]
const IMMUTABLE: &'static [&'static str]
CLIENT_SETTABLE properties the spec marks “immutable”: “The
value MUST NOT change after the object is created.” (RFC 8620 §1.1).
A property the /set method text accepts on create but not on update
is immutable too. Read more