Skip to main content

ical/prop/
repeat.rs

1//! # REPEAT
2//!
3//! The `REPEAT` property: how many times an alarm repeats after it first fires
4//! (RFC 5545 3.8.6.2).
5
6use crate::{
7    prop::{IcalPropKind, cardinality::IcalPropCardinality, spec::IcalPropSpec},
8    value::IcalValueKind,
9    version::IcalVersion,
10};
11
12/// The `REPEAT` property marker.
13pub struct REPEAT;
14
15impl IcalPropSpec for REPEAT {
16    const KIND: IcalPropKind = IcalPropKind::Repeat;
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::Integer]
28    }
29}