#[non_exhaustive]pub struct BusyPeriod {
pub utc_start: UTCDate,
pub utc_end: UTCDate,
pub busy_status: BusyStatus,
pub event: Option<Value>,
pub account_id: Option<Id>,
pub extra: Map<String, Value>,
}Expand description
A single busy period returned by Principal/getAvailability
(draft-ietf-jmap-calendars-33 §2.2).
The server returns an array of BusyPeriod objects representing time ranges
when the principal is occupied. If showDetails was false in the request
(or the calendar has privacy:"secret", or the requesting user lacks
mayReadItems rights), the event and account_id fields are null.
§Field semantics
utc_start/utc_end— inclusive/exclusive UTC date-time bounds of the busy period; both are always present.busy_status— the kind of busy time;BusyStatus::Unavailablewhen absent on the wire.event— the underlyingcrate::CalendarEventif the requesting user has the right to see it, otherwisenull.account_id— the JMAP account id of the calendar containing this event;nullwheneventisnull.
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.utc_start: UTCDateUTC start of the busy period (inclusive).
Uses the UTCDate newtype (RFC 8620 §1.4) rather than a bare
String to make the wire-format constraint
(20-character YYYY-MM-DDTHH:MM:SSZ) explicit at the type level.
JSON serialization is unchanged because UTCDate is a transparent
newtype.
utc_end: UTCDateUTC end of the busy period (exclusive).
See utc_start for the typing rationale.
busy_status: BusyStatusCharacterisation of the busy time; an absent busyStatus
deserializes as BusyStatus::Unavailable, the draft’s default.
event: Option<Value>The underlying event, if the requester has read access.
Represented as a raw JSON value because the server emits a
server-side projection of the crate::CalendarEvent rather
than the full object:
- draft-ietf-jmap-calendars-33 §2.2 (the
Principal/getAvailabilityeventPropertiesargument) restricts the returned representation to a caller-requested property subset. - The server also enforces privacy and
mayReadItemspermission filtering on a per-event basis (the spec lists the conditions under whicheventisnull).
Modelling that projection at the type level would require either
a typed partial-CalendarEvent shape (large, tracks the spec) or
Option<crate::CalendarEvent> where every field is Option by
workspace convention. Using serde_json::Value keeps the
projection nature explicit on the wire, avoids forcing
availability consumers to walk the full CalendarEvent deserialize
path, and lets callers that need typed access deserialize the
value into crate::CalendarEvent on demand.
(The previous version of this docstring cited a “circular type
dependency” between BusyPeriod and CalendarEvent. That was
inaccurate — both live in the same crate as sibling modules and
neither depends on the other.)
account_id: Option<Id>JMAP account id of the calendar containing this event.
null (i.e., None) when event is null.
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).