ical/tree/prop/
priority.rs1use crate::{
6 prop::IcalPropKind,
7 tree::{
8 line::IcalLine,
9 prop::{IcalPropCardinality, IcalPropLens, IcalPropSpec},
10 value::IcalValueCursor,
11 },
12 value::IcalValueKind,
13 value::integer::IcalInteger,
14 version::IcalVersion,
15};
16
17#[allow(non_camel_case_types)]
19pub struct PRIORITY;
20
21impl IcalPropLens for PRIORITY {
22 type Target<'v> = IcalInteger<'v>;
23
24 type Cursor<'c, 'a>
25 = IcalValueCursor<'c, 'a>
26 where
27 'a: 'c;
28
29 fn cursor<'c, 'a>(line: &'c mut IcalLine<'a>) -> IcalValueCursor<'c, 'a> {
30 IcalValueCursor { line }
31 }
32}
33
34impl IcalPropSpec for PRIORITY {
35 const KIND: IcalPropKind = IcalPropKind::Priority;
36
37 fn cardinality(_version: IcalVersion) -> IcalPropCardinality {
38 IcalPropCardinality::AtMostOne
39 }
40
41 fn allowed_values(_version: IcalVersion) -> &'static [IcalValueKind] {
42 &[IcalValueKind::Integer]
43 }
44}