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
Trait Implementations§
impl Eq for Trigger
impl StructuralPartialEq for Trigger
Auto Trait Implementations§
impl Freeze for Trigger
impl RefUnwindSafe for Trigger
impl Send for Trigger
impl Sync for Trigger
impl Unpin for Trigger
impl UnwindSafe for Trigger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more