pub struct RecurrenceRule { /* private fields */ }Expand description
A recurrence rule
Implementations§
Source§impl RecurrenceRule
impl RecurrenceRule
Sourcepub fn not_before(&self) -> &NaiveDate
pub fn not_before(&self) -> &NaiveDate
This rule is not valid before the specified NaiveDate (inclusive)
Sourcepub fn not_after(&self) -> &Option<NaiveDate>
pub fn not_after(&self) -> &Option<NaiveDate>
This rule is not valid after the specified NaiveDate
Sourcepub fn max_occurrences(&self) -> &Option<u64>
pub fn max_occurrences(&self) -> &Option<u64>
The maximum number of occurrences for this rule, or unlimited if None.
Sourcepub fn day_filter(&self) -> &DayFilter
pub fn day_filter(&self) -> &DayFilter
A bitflag day filter, xMTWTFSS, 01111111 means this can be paid any day.
Sourcepub fn resolve(&self) -> &ResolveDirection
pub fn resolve(&self) -> &ResolveDirection
If the bitflag day filter cannot be met, should it be resolved into the future or the past?
Source§impl RecurrenceRule
impl RecurrenceRule
Sourcepub fn set_max_occurrences(&mut self, val: Option<u64>) -> &mut Self
pub fn set_max_occurrences(&mut self, val: Option<u64>) -> &mut Self
The maximum number of occurrences for this rule, or unlimited if None.
Sourcepub fn set_frequency(&mut self, val: Frequency) -> &mut Self
pub fn set_frequency(&mut self, val: Frequency) -> &mut Self
At what frequency should this rule reoccur?
Sourcepub fn set_day_filter(&mut self, val: DayFilter) -> &mut Self
pub fn set_day_filter(&mut self, val: DayFilter) -> &mut Self
A bitflag day filter, xMTWTFSS, 01111111 means this can be paid any day.
Sourcepub fn set_resolve(&mut self, val: ResolveDirection) -> &mut Self
pub fn set_resolve(&mut self, val: ResolveDirection) -> &mut Self
If the bitflag day filter cannot be met, should it be resolved into the future or the past?
Source§impl RecurrenceRule
impl RecurrenceRule
Sourcepub fn set_not_before(&mut self, not_before: NaiveDate) -> bool
pub fn set_not_before(&mut self, not_before: NaiveDate) -> bool
Set the date at which this rule is not valid before. Will return false
if it wasn’t able to set due to the provided date being after the
not_after date.
Sourcepub fn set_not_before_unchecked(&mut self, not_before: NaiveDate)
pub fn set_not_before_unchecked(&mut self, not_before: NaiveDate)
Set the date at which this rule is not valid before.
Preferably, you should use Self::set_not_before.
Sourcepub fn set_not_after(&mut self, not_after: Option<NaiveDate>) -> bool
pub fn set_not_after(&mut self, not_after: Option<NaiveDate>) -> bool
Set the date at which this rule is not valid before. Will return false
if it wasn’t able to set due to the provided date being after the
not_after date.
Sourcepub fn set_not_after_unchecked(&mut self, not_after: Option<NaiveDate>)
pub fn set_not_after_unchecked(&mut self, not_after: Option<NaiveDate>)
Set the date at which this rule is not valid after.
Preferably, you should use Self::set_not_after.
Sourcepub fn iter_after(&self, start_point: &NaiveDate) -> Iter<'_> ⓘ
pub fn iter_after(&self, start_point: &NaiveDate) -> Iter<'_> ⓘ
Create an iterator for all occurrences, starting at the provided start_point (exclusive).
Sourcepub fn iter(&self) -> Iter<'_> ⓘ
pub fn iter(&self) -> Iter<'_> ⓘ
Create an iterator for all occurrences, starting at Self::not_before (inclusive).
§Panics
This will panic if Self::not_before is the beginning of time.
Trait Implementations§
Source§impl Clone for RecurrenceRule
impl Clone for RecurrenceRule
Source§fn clone(&self) -> RecurrenceRule
fn clone(&self) -> RecurrenceRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more