use crate::{
prop::IcalPropKind,
tree::{
line::IcalLine,
prop::{IcalPropCardinality, IcalPropLens, IcalPropSpec},
value::IcalValueCursor,
},
value::IcalValueKind,
value::datetime::IcalDateTime,
version::IcalVersion,
};
#[allow(non_camel_case_types)]
pub struct LAST_MODIFIED;
impl IcalPropLens for LAST_MODIFIED {
type Target<'v> = IcalDateTime<'v>;
type Cursor<'c, 'a>
= IcalValueCursor<'c, 'a>
where
'a: 'c;
fn cursor<'c, 'a>(line: &'c mut IcalLine<'a>) -> IcalValueCursor<'c, 'a> {
IcalValueCursor { line }
}
}
impl IcalPropSpec for LAST_MODIFIED {
const KIND: IcalPropKind = IcalPropKind::LastModified;
fn cardinality(_version: IcalVersion) -> IcalPropCardinality {
IcalPropCardinality::AtMostOne
}
fn allowed_values(_version: IcalVersion) -> &'static [IcalValueKind] {
&[IcalValueKind::DateTime]
}
}