Skip to main content

ical/tree/component/
vevent.rs

1//! # VEVENT component lens
2//!
3//! The `VEVENT` component lens.
4
5use crate::{
6    component::IcalComponentKind,
7    prop::IcalPropKind,
8    tree::component::{IcalComponentLens, IcalComponentSpec},
9};
10
11/// The `VEVENT` component lens.
12#[allow(non_camel_case_types)]
13pub struct VEVENT;
14
15impl IcalComponentLens for VEVENT {}
16
17impl IcalComponentSpec for VEVENT {
18    const KIND: IcalComponentKind = IcalComponentKind::VEvent;
19
20    fn allowed_children() -> &'static [IcalComponentKind] {
21        &[
22            IcalComponentKind::VAlarm,
23            IcalComponentKind::Participant,
24            IcalComponentKind::VLocation,
25            IcalComponentKind::VResource,
26        ]
27    }
28
29    fn required_props() -> &'static [IcalPropKind] {
30        &[IcalPropKind::Uid, IcalPropKind::DtStamp]
31    }
32}