pub struct RRuleSet { /* private fields */ }
Expand description
A validated Recurrence Rule that can be used to create an iterator.
Implementations§
source§impl RRuleSet
impl RRuleSet
sourcepub fn limit(self) -> Self
pub fn limit(self) -> Self
Enable validation limits.
This is only needed if you are going to use the Iterator api directly.
sourcepub fn before(self, dt: DateTime<Tz>) -> Self
pub fn before(self, dt: DateTime<Tz>) -> Self
Only return recurrences that comes before this DateTime
.
This value will not be used if you use the Iterator
API directly.
sourcepub fn after(self, dt: DateTime<Tz>) -> Self
pub fn after(self, dt: DateTime<Tz>) -> Self
Only return recurrences that comes after this DateTime
.
This value will not be used if you use the Iterator
API directly.
sourcepub fn set_rrules(self, rrules: Vec<RRule>) -> Self
pub fn set_rrules(self, rrules: Vec<RRule>) -> Self
Sets the rrules of the set.
sourcepub fn set_rdates(self, rdates: Vec<DateTime<Tz>>) -> Self
pub fn set_rdates(self, rdates: Vec<DateTime<Tz>>) -> Self
Sets the rdates of the set.
sourcepub fn set_exdates(self, exdates: Vec<DateTime<Tz>>) -> Self
pub fn set_exdates(self, exdates: Vec<DateTime<Tz>>) -> Self
Set the exdates of the set.
sourcepub fn get_exrule(&self) -> &Vec<RRule>
pub fn get_exrule(&self) -> &Vec<RRule>
Returns the exrules of the set.
sourcepub fn get_exdate(&self) -> &Vec<DateTime<Tz>>
pub fn get_exdate(&self) -> &Vec<DateTime<Tz>>
Returns the exdates of the set.
sourcepub fn get_dt_start(&self) -> &DateTime<Tz>
pub fn get_dt_start(&self) -> &DateTime<Tz>
Returns the start datetime of the recurring event.
sourcepub fn all(self, limit: u16) -> RRuleResult
pub fn all(self, limit: u16) -> RRuleResult
Returns all the recurrences of the rrule.
Limit must be set in order to prevent infinite loops.
The max limit is 65535
. If you need more please use into_iter
directly.
§Usage
use rrule::RRuleSet;
let rrule_set: RRuleSet = "DTSTART:20210101T090000Z\nRRULE:FREQ=DAILY".parse().unwrap();
// Limit the results to 2 recurrences
let result = rrule_set.all(2);
assert_eq!(result.dates.len(), 2);
assert_eq!(result.limited, true);
sourcepub fn all_unchecked(self) -> Vec<DateTime<Tz>>
pub fn all_unchecked(self) -> Vec<DateTime<Tz>>
Returns all the recurrences of the rrule.
§Note
This method does not enforce any validation limits and might lead to
very long iteration times. Please read the SECURITY.md
for more information.
sourcepub fn set_from_string(self, s: &str) -> Result<Self, RRuleError>
pub fn set_from_string(self, s: &str) -> Result<Self, RRuleError>
Set the RRuleSet
properties from a string. If a DTSTART is found, it will be used as the start datetime.