ics

Module components

Source
Expand description

Basic components for building custom calendar objects.

To create new custom (IANA/non-standard) calendar components/properties/parameters, the Display implementation of the base components should be used to avoid conflicting formatting.

§Example

// Implementing Display for new component
use ics::components::Component;
use std::fmt;

pub struct MyCustomComponent<'a>(Component<'a>);

impl<'a> fmt::Display for MyCustomComponent<'a> {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}", self.0)
    }
}

Structs§

  • A Component contains properties and sometimes sub-components.
  • A Parameter is a key-value that can be added to a property to specify it more.
  • A Property contains a key-value pair which can have optionally several parameters.

Type Aliases§

  • Parameters is a collection of Parameters. It can be created with the parameters! macro.