Skip to main content

ical/prop/
completed.rs

1//! # COMPLETED
2//!
3//! The `COMPLETED` property: when a to-do was completed (RFC 5545 3.8.2.1).
4
5use crate::{
6    prop::{IcalPropKind, cardinality::IcalPropCardinality, spec::IcalPropSpec},
7    value::IcalValueKind,
8    version::IcalVersion,
9};
10
11/// The `COMPLETED` property marker.
12pub struct COMPLETED;
13
14impl IcalPropSpec for COMPLETED {
15    const KIND: IcalPropKind = IcalPropKind::Completed;
16
17    fn cardinality(_version: IcalVersion) -> IcalPropCardinality {
18        IcalPropCardinality::AtMostOne
19    }
20
21    fn allowed_values(_version: IcalVersion) -> &'static [IcalValueKind] {
22        &[IcalValueKind::DateTime]
23    }
24}