[][src]Struct ics::ICalendar

pub struct ICalendar<'a>(_);

The iCalendar object specified as VCALENDAR.

An ICalendar consists of calendar properties and one or more calendar components. Properties are attributes that apply to the calendar object as a whole. (see RFC5545 3.4 iCalendar Object) The ICalendar struct can be thought of as the iCalendar object. This is where the specified components are added. To save the object as file, it needs to be written to a file.

Methods

impl<'a> ICalendar<'a>[src]

pub fn new<V, P>(version: V, prodid: P) -> Self where
    V: Into<Cow<'a, str>>,
    P: Into<Cow<'a, str>>, 
[src]

Creates a new iCalendar object/"VCALENDAR" calendar component. The "VERSION" and "PRODID" properties are required.

pub fn push<P>(&mut self, property: P) where
    P: Into<Property<'a>>, 
[src]

Adds a property to the iCalendar object. Calendar properties are like calendar attributes.

pub fn add_component<C>(&mut self, component: C) where
    C: Into<Component<'a>>, 
[src]

Adds a Component to the iCalendar object. This should be only used for IANA/non-standard components.

pub fn add_event(&mut self, event: Event<'a>)[src]

Adds an Event component to the iCalendar object.

pub fn add_todo(&mut self, todo: ToDo<'a>)[src]

Adds a ToDo component to the iCalendar object.

pub fn add_journal(&mut self, journal: Journal<'a>)[src]

Adds a Journal component to the iCalendar object.

pub fn add_freebusy(&mut self, freebusy: FreeBusy<'a>)[src]

Adds a FreeBusy component to the iCalendar object.

pub fn add_timezone(&mut self, timezone: TimeZone<'a>)[src]

Adds a TimeZone component to the iCalendar object.

pub fn write<W>(&self, writer: W) -> Result<()> where
    W: Write
[src]

Generic convenience method to write the content of the iCalendar object to a writer in the iCalendar format.

pub fn save_file<P>(&self, filename: P) -> Result<()> where
    P: AsRef<Path>, 
[src]

Creates a file from the path and saves the content of the iCalendar object in the iCalendar format inside the file.

Trait Implementations

impl<'a> Ord for ICalendar<'a>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

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

Restrict a value to a certain interval. Read more

impl<'a> Clone for ICalendar<'a>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Eq for ICalendar<'a>[src]

impl<'a> From<ICalendar<'a>> for Component<'a>[src]

impl<'a> PartialEq<ICalendar<'a>> for ICalendar<'a>[src]

impl<'a> PartialOrd<ICalendar<'a>> for ICalendar<'a>[src]

impl<'a> Hash for ICalendar<'a>[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'a> Display for ICalendar<'a>[src]

impl<'a> Debug for ICalendar<'a>[src]

Auto Trait Implementations

impl<'a> Sync for ICalendar<'a>

impl<'a> Unpin for ICalendar<'a>

impl<'a> Send for ICalendar<'a>

impl<'a> RefUnwindSafe for ICalendar<'a>

impl<'a> UnwindSafe for ICalendar<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]