Skip to main content

IcalRecurSet

Struct IcalRecurSet 

Source
pub struct IcalRecurSet {
    pub start: Option<IcalRecurDateTime>,
    pub rules: Vec<IcalRecurRule>,
    pub dates: Vec<IcalRecurDateTime>,
    pub exrules: Vec<IcalRecurRule>,
    pub exdates: Vec<IcalRecurDateTime>,
    pub overrides: Vec<IcalRecurOverride>,
}
Expand description

The recurrence set of one component: what adds, subtracts and overrides.

Build one from a decoded component with of_component, or by hand, and walk it with expand.

Fields§

§start: Option<IcalRecurDateTime>

The DTSTART, always the first instance of the set (RFC 5545 3.8.2.4).

§rules: Vec<IcalRecurRule>

Every RRULE.

§dates: Vec<IcalRecurDateTime>

Every date named by an RDATE, in order. A period item contributes its start.

§exrules: Vec<IcalRecurRule>

Every EXRULE, deprecated by RFC 5545 but still on the wire.

§exdates: Vec<IcalRecurDateTime>

Every date named by an EXDATE, in order.

§overrides: Vec<IcalRecurOverride>

The overrides that replace instances, in order of identity.

Implementations§

Source§

impl IcalRecurSet

Source

pub fn of_component(component: &IcalComponent<'_>) -> Self

Read the set a decoded component denotes, its overrides aside.

A component with no DTSTART and no RDATE denotes nothing and comes back empty rather than as an error: this is the liberal side of the crate. A malformed date or rule is skipped for the same reason.

Source

pub fn with_override(&mut self, component: &IcalComponent<'_>) -> &mut Self

Add the override a sibling component carrying a RECURRENCE-ID states.

A component with no RECURRENCE-ID, or with no DTSTART to move the instance to, is not an override and is ignored.

Source

pub fn of_uid(components: &[IcalComponent<'_>], uid: &str) -> Self

The set a whole calendar denotes for one UID: the series component, plus every sibling that overrides an instance of it.

The series is the component carrying that UID with no RECURRENCE-ID; every other one carrying it is an override.

Source

pub fn expand(&self) -> IcalRecurSetExpand<'_>

Walk the set, lazily, in identity order.

Source

pub fn expand_in_zone(&self, zone: &IcalTz) -> IcalRecurSetExpand<'_>

Walk the set against a time zone, dropping the instances its rules generate at local times the zone jumps over (RFC 5545 3.3.10).

The filter sits on the rule streams alone. An RDATE does not generate an instance, it names one, so a date written into one is as deliberate as a lone DTSTART and is kept whatever the zone says of it.

Trait Implementations§

Source§

impl Clone for IcalRecurSet

Source§

fn clone(&self) -> IcalRecurSet

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IcalRecurSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IcalRecurSet

Source§

fn default() -> IcalRecurSet

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

impl Eq for IcalRecurSet

Source§

impl PartialEq for IcalRecurSet

Source§

fn eq(&self, other: &IcalRecurSet) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for IcalRecurSet

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.