Skip to main content

ical/prop/
trigger.rs

1//! # TRIGGER
2//!
3//! The `TRIGGER` property: when an alarm fires, relative to the component or at
4//! an absolute time (RFC 5545 3.8.6.3).
5
6use crate::{
7    prop::{IcalPropKind, cardinality::IcalPropCardinality, spec::IcalPropSpec},
8    value::IcalValueKind,
9    version::IcalVersion,
10};
11
12/// The `TRIGGER` property marker.
13pub struct TRIGGER;
14
15impl IcalPropSpec for TRIGGER {
16    const KIND: IcalPropKind = IcalPropKind::Trigger;
17
18    fn allowed_versions() -> &'static [IcalVersion] {
19        &[IcalVersion::V2_0]
20    }
21
22    fn cardinality(_version: IcalVersion) -> IcalPropCardinality {
23        IcalPropCardinality::AtMostOne
24    }
25
26    fn allowed_values(_version: IcalVersion) -> &'static [IcalValueKind] {
27        &[IcalValueKind::Duration]
28    }
29}