pub enum Trigger {
Duration(Duration, Option<Related>),
DateTime(CalendarDateTime),
}
Expand description
Describes when an alarm is supposed to occure.
RFC 5545, Section 3.8.6.3, see also Alarm Trigger Relationship This property specifies when an alarm will trigger.
Variants§
Duration(Duration, Option<Related>)
Duration in relation to either Start or End of the event
DateTime(CalendarDateTime)
Absolute DateTime of the Trigger
Implementations§
source§impl Trigger
impl Trigger
sourcepub fn after_start(duration: Duration) -> Trigger
pub fn after_start(duration: Duration) -> Trigger
assert_eq!(
Trigger::after_start(Duration::hours(1)),
Trigger::Duration(Duration::hours(1), Some(Related::Start))
)
please don’t supply negative durations, you’ll just confuse everybody
sourcepub fn after_end(duration: Duration) -> Trigger
pub fn after_end(duration: Duration) -> Trigger
assert_eq!(
Trigger::after_end(Duration::hours(1)),
Trigger::Duration(Duration::hours(1), Some(Related::End))
)
please don’t supply negative durations, you’ll just confuse everybody
sourcepub fn before_start(duration: Duration) -> Trigger
pub fn before_start(duration: Duration) -> Trigger
assert_eq!(
Trigger::before_start(Duration::hours(1)),
Trigger::Duration(-Duration::hours(1), Some(Related::Start))
)
please don’t supply negative durations, you’ll just confuse everybody
sourcepub fn before_end(duration: Duration) -> Trigger
pub fn before_end(duration: Duration) -> Trigger
assert_eq!(
Trigger::before_end(Duration::hours(1)),
Trigger::Duration(-Duration::hours(1), Some(Related::End))
)
please don’t supply negative durations, you’ll just confuse everybody
sourcepub fn as_duration(&self) -> Option<&Duration>
pub fn as_duration(&self) -> Option<&Duration>
sourcepub fn as_date_time(&self) -> Option<&CalendarDateTime>
pub fn as_date_time(&self) -> Option<&CalendarDateTime>
Returns the containing CalendarDateTime
if the Trigger
contains one