Skip to main content

BusyPeriod

Struct BusyPeriod 

Source
#[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::Unavailable when absent on the wire.
  • event — the underlying crate::CalendarEvent if the requesting user has the right to see it, otherwise null.
  • account_id — the JMAP account id of the calendar containing this event; null when event is null.

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.
§utc_start: UTCDate

UTC 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: UTCDate

UTC end of the busy period (exclusive).

See utc_start for the typing rationale.

§busy_status: BusyStatus

Characterisation 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/getAvailability eventProperties argument) restricts the returned representation to a caller-requested property subset.
  • The server also enforces privacy and mayReadItems permission filtering on a per-event basis (the spec lists the conditions under which event is null).

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

Trait Implementations§

Source§

impl Clone for BusyPeriod

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 BusyPeriod

Source§

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

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

impl<'de> Deserialize<'de> for BusyPeriod

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 BusyPeriod

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 BusyPeriod

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 BusyPeriod

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.