pub struct RRuleProperties {
Show 16 fields pub freq: Frequency, pub interval: u16, pub count: Option<u32>, pub until: Option<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.

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 of 2 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.

The interval between each freq iteration.

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 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.

If given, it must be either an integer, or a sequence of integers, meaning the seconds to apply the recurrence to.

Create and validate the given properties and make sure they are valid before creating an RRule struct. If the properties are not valid it will return an error.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Generates a string based on the iCalendar RRULE spec. It doesn’t prepend “RRULE:” to the string. This function doesn’t validate the existing object and may generate an invalid string like ‘FREQ=YEARLY;INTERVAL=-1’

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.