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§
source§impl PartialEq for Trigger
impl PartialEq for Trigger
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)