Skip to main content

ical/prop/
created.rs

1//! # CREATED
2//!
3//! The `CREATED` property: when the component was first created (RFC 5545
4//! 3.8.7.1).
5
6use crate::{
7    prop::{IcalPropKind, cardinality::IcalPropCardinality, spec::IcalPropSpec},
8    value::IcalValueKind,
9    version::IcalVersion,
10};
11
12/// The `CREATED` property marker.
13pub struct CREATED;
14
15impl IcalPropSpec for CREATED {
16    const KIND: IcalPropKind = IcalPropKind::Created;
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::DateTime]
28    }
29}