Skip to main content

jmap_calendars_types/
lib.rs

1//! JMAP Calendars extension data types.
2//!
3//! Implements the data model from draft-ietf-jmap-calendars-33 and the
4//! JSCalendar Event format of RFC 8984.  Types only — no method handlers,
5//! no async, no network I/O.
6//!
7//! ## Crate family position
8//!
9//! ```text
10//! jmap-types (RFC 8620 wire primitives)
11//!     └── jmap-calendars-types  ← this crate
12//!             ├── jmap-calendars-server (method handlers)
13//!             └── jmap-calendars-client (client extension trait)
14//! ```
15//!
16//! ## Modules
17//!
18//! | Module | Contents |
19//! |---|---|
20//! | `calendar` | [`Calendar`], [`CalendarRights`], [`IncludeInAvailability`] |
21//! | `event` | [`CalendarEvent`], [`CalendarEventFilterCondition`], [`CalendarEventComparator`], [`CalendarEventComparatorProperty`] |
22//! | `jmap-jscalendar-types` | Re-exported: [`RecurrenceRule`], [`NDay`], [`Location`], [`VirtualLocation`], [`Link`], [`Participant`], [`Alert`], [`AlertTrigger`], [`OffsetTrigger`], [`AbsoluteTrigger`], [`Relation`], [`LocalDateTime`], [`Duration`], [`SignedDuration`] |
23//! | `notification` | [`CalendarEventNotification`], [`Person`], [`NotificationType`], [`NotificationFilterCondition`], [`CalendarEventNotificationComparator`], [`CalendarEventNotificationComparatorProperty`] |
24//! | `participant_identity` | [`ParticipantIdentity`] |
25//! | Crate root | [`CalendarsCapability`], [`CalendarsAccountCapability`], URI constants |
26//!
27//! The JSCalendar sub-object types (RFC 8984) live in the dedicated
28//! `jmap-jscalendar-types` crate so `jmap-tasks-types` can also consume
29//! them without depending on this crate. They are re-exported here at
30//! the crate root (top-level names like `Location`, `Participant`,
31//! `Alert`).
32
33#![forbid(unsafe_code)]
34
35mod availability;
36mod backend;
37mod calendar;
38mod capability;
39mod event;
40mod notification;
41mod participant_identity;
42
43// ── Top-level re-exports ──────────────────────────────────────────────────────
44
45pub use availability::{BusyPeriod, BusyStatus};
46pub use calendar::{Calendar, CalendarRights, IncludeInAvailability};
47pub use capability::{
48    CalendarsAccountCapability, CalendarsCapability, CalendarsParseCapability,
49    JMAP_CALENDARS_PARSE_URI, JMAP_CALENDARS_URI, JMAP_PRINCIPALS_AVAILABILITY_URI,
50    PrincipalCalendarsCapability, PrincipalsAvailabilityAccountCapability,
51    PrincipalsAvailabilityCapability,
52};
53pub use event::{
54    CalendarEvent, CalendarEventComparator, CalendarEventComparatorProperty, CalendarEventFilter,
55    CalendarEventFilterCondition,
56};
57pub use jmap_jscalendar_types::{
58    AbsoluteTrigger, Alert, AlertTrigger, Duration, Link, LocalDateTime, Location, NDay,
59    OffsetTrigger, Participant, RecurrenceRule, Relation, SignedDuration, TimeZone, TimeZoneRule,
60    VirtualLocation,
61};
62pub use notification::{
63    CalendarAlert, CalendarEventNotification, CalendarEventNotificationComparator,
64    CalendarEventNotificationComparatorProperty, NotificationFilter, NotificationFilterCondition,
65    NotificationType, Person,
66};
67pub use participant_identity::ParticipantIdentity;
68
69/// Generic filter algebra from `jmap-types` (RFC 8620 §5.5).
70///
71/// Re-exported here so callers of `jmap-calendars-types` do not need a
72/// direct dependency on `jmap-types`. Mirrors the same root
73/// re-exports in `jmap-mail-types`, the workspace canonical
74/// extension-types template.
75pub use jmap_types::{Filter, FilterOperator, Operator};
76
77// ── Backend re-exports ────────────────────────────────────────────────────────
78
79pub use backend::{
80    CalendarEventNotificationProperty, CalendarEventProperty, CalendarProperty,
81    PER_USER_CALENDAR_EVENT_PROPERTIES, ParticipantIdentityProperty,
82    is_per_user_calendar_event_property,
83};