Skip to main content

ical/component/
vcalendar.rs

1//! # VCALENDAR
2//!
3//! The `VCALENDAR` component: the calendar envelope every other component sits
4//! in (RFC 5545 3.4).
5
6use crate::{
7    component::{IcalComponentKind, spec::IcalComponentSpec},
8    prop::IcalPropKind,
9};
10
11/// The `VCALENDAR` component marker.
12pub struct VCALENDAR;
13
14impl IcalComponentSpec for VCALENDAR {
15    const KIND: IcalComponentKind = IcalComponentKind::VCalendar;
16
17    fn allowed_children() -> &'static [IcalComponentKind] {
18        &[
19            IcalComponentKind::VEvent,
20            IcalComponentKind::VTodo,
21            IcalComponentKind::VJournal,
22            IcalComponentKind::VFreeBusy,
23            IcalComponentKind::VTimezone,
24            IcalComponentKind::VAvailability,
25        ]
26    }
27
28    fn required_props() -> &'static [IcalPropKind] {
29        &[IcalPropKind::ProdId]
30    }
31}