Struct rrule::RRuleProperties
source · [−]pub struct RRuleProperties {Show 18 fields
pub freq: Frequency,
pub interval: u16,
pub count: Option<u32>,
pub until: Option<DateTime<Tz>>,
pub tz: Tz,
pub dt_start: DateTime<Tz>,
pub week_start: Weekday,
pub by_set_pos: Vec<i32>,
pub by_month: Vec<u8>,
pub by_month_day: Vec<i8>,
pub by_n_month_day: Vec<i8>,
pub by_year_day: Vec<i16>,
pub by_week_no: Vec<i8>,
pub by_weekday: Vec<NWeekday>,
pub by_hour: Vec<u8>,
pub by_minute: Vec<u8>,
pub by_second: Vec<u8>,
pub by_easter: Option<i16>,
}
Fields
freq: Frequency
The frequency of the rule. For example: yearly, weekly, hourly
interval: u16
The interval between each frequency iteration. For example:
- A yearly frequency with an interval of
2
creates 1 event every two years. - An hourly frequency with an interval of
2
created 1 event every two hours.
count: Option<u32>
How many occurrences will be generated.
until: Option<DateTime<Tz>>
The end date after which new events will no longer be generated.
If the DateTime
is equal to an instance of the event it will be the last event.
tz: Tz
The timezone used during the creation of the events.
dt_start: DateTime<Tz>
The start datetime of the recurring event.
week_start: Weekday
The start day of the week. This will affect recurrences based on weekly periods.
by_set_pos: Vec<i32>
Occurrence number corresponding to the frequency period. For example:
- A monthly frequency with an
by_set_pos
of-1
meaning the last day of the month. - An hourly frequency with an
by_set_pos
of2
meaning the 2nd hour. (TODO Check)
by_month: Vec<u8>
The months to apply the recurrence to. Can be a value from 1 to 12.
by_month_day: Vec<i8>
The month days to apply the recurrence to. Can be a value from -31 to -1 and 1 to 31.
by_n_month_day: Vec<i8>
by_year_day: Vec<i16>
The year days to apply the recurrence to. Can be a value from -366 to -1 and 1 to 366.
by_week_no: Vec<i8>
The week numbers to apply the recurrence to.
Week numbers have the meaning described in ISO8601, that is,
the first week of the year is that containing at least four days of the new year.
Week day starts counting on from week_start
value.
Can be a value from -53 to -1 and 1 to 53.
by_weekday: Vec<NWeekday>
The days of the week the rules should be recurring.
Should be a value of Weekday
and optionally with a prefix of -366 to 366 depending on frequency.
Corresponds with BYDAY
field.
by_hour: Vec<u8>
The hours to apply the recurrence to. Can be a value from 0 to 23.
by_minute: Vec<u8>
The minutes to apply the recurrence to. Can be a value from 0 to 59.
by_second: Vec<u8>
The seconds to apply the recurrence to. Can be a value from 0 to 59.
by_easter: Option<i16>
Extension, not part of RFC spec.
Amount of days/months from Easter Sunday itself.
Can be a value from -366 to 366.
Note: Only used when by-easter
feature flag is set. Otherwise, it is ignored.
Implementations
The FREQ rule part identifies the type of recurrence rule.
If given, this determines how many occurrences will be generated.
If given, this must be a datetime instance specifying the upper-bound limit of the recurrence.
The recurrence start. Recurrences generated by the rrule will be in the same time zone as the start date.
The week start day. This will affect recurrences based on weekly periods.
The default week start is Weekday::Mon
.
If given, it must be either an integer, or a sequence of integers, positive or negative. Each given integer will specify an occurrence number, corresponding to the nth occurrence of the rule inside the frequency period. For example, a by_set_pos of -1 if combined with a MONTHLY frequency, and a by_weekday of (MO, TU, WE, TH, FR), will result in the last work day of every month.
If given, it must be either an integer, or a sequence of integers, meaning the months to apply the recurrence to.
If given, it must be either an integer, or a sequence of integers, meaning the month days to apply the recurrence to.
If given, it must be either an integer, or a sequence of integers, meaning the year days to apply the recurrence to.
If given, it must be either an integer, or a sequence of integers, meaning the week numbers to apply the recurrence to. Week numbers have the meaning described in ISO8601, that is, the first week of the year is that containing at least four days of the new year.
If given, it must be either an integer (0 == MO), a sequence of integers, one of the weekday constants (MO, TU, etc.), or a sequence of these constants. When given, these variables will define the weekdays where the recurrence will be applied. A nth occurrence prefix can be given.
If given, it must be either an integer, or a sequence of integers, meaning the hours to apply the recurrence to.
If given, it must be either an integer, or a sequence of integers, meaning the minutes to apply the recurrence to.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for RRuleProperties
impl Send for RRuleProperties
impl Sync for RRuleProperties
impl Unpin for RRuleProperties
impl UnwindSafe for RRuleProperties
Blanket Implementations
Mutably borrows from an owned value. Read more