Skip to main content

ical/tree/prop/
refresh_interval.rs

1//! # REFRESH-INTERVAL lens
2//!
3//! Reading and editing the `REFRESH-INTERVAL` property in place: it decodes as
4//! an [`IcalDuration`] and edits through the generic [`IcalValueCursor`].
5//!
6//! Its RFC contract sits on the marker, [`REFRESH_INTERVAL`].
7
8use crate::{
9    prop::refresh_interval::REFRESH_INTERVAL,
10    tree::{line::IcalLine, prop::lens::IcalPropLens, value::cursor::IcalValueCursor},
11    value::duration::IcalDuration,
12};
13
14impl IcalPropLens for REFRESH_INTERVAL {
15    type Target<'v> = IcalDuration<'v>;
16
17    type Cursor<'c, 'a>
18        = IcalValueCursor<'c, 'a>
19    where
20        'a: 'c;
21
22    fn cursor<'c, 'a>(line: &'c mut IcalLine<'a>) -> IcalValueCursor<'c, 'a> {
23        IcalValueCursor { line }
24    }
25}