[−][src]Crate icalendar
A library (far from anything) to generate icalendars This implementation is still far from complete, I haven't even read the entire spec yet. Instead I implemented the parts I needed first. More to come, contributions very welcome.
Structure
Calendar
s consist ofComponents
Component
s are e.g.Event
orTodo
Component
s consist ofProperty
sProperty
s may haveParameter
s
let event = Event::new() .summary("test event") .description("here I have something really important to do") .starts(Utc::now()) .class(Class::Confidential) .ends(Utc::now() + Duration::days(1)) .append_property(Property::new("TEST", "FOOBAR") .add_parameter("IMPORTANCE", "very") .add_parameter("DUE", "tomorrow") .done()) .done(); let bday = Event::new() .all_day(Utc.ymd(2016, 3, 15)) .summary("My Birthday") .description( r#"Hey, I'm gonna have a party BYOB: Bring your own beer. Hendrik"# ) .done(); let todo = Todo::new().summary("Buy some milk").done(); let mut calendar = Calendar::new(); calendar.add(event); calendar.add(todo); calendar.add(bday);
Breaking API Changes in version 0.7.0
- Todo::due and Todo::completed now take their date-time argument by value rather than by reference
- Todo::completed now requires its chrono::DateTime argument to have exactly chrono::Utc specified as its time zone as mandated by the RFC.
- Component::starts, Component::ends and Todo::due now take newly introduced
CalendarDateTime (through
Into<CalendarDateTime>
indirection). This allows callers to define time zone handling. Conversions fromchrono::NaiveDateTime
andchrono::DateTime<Utc>
are provided for ergonomics, the latter also restoring API compatibility in case of UTC date-times.
Structs
Calendar | Represents a calendar |
Event | VEVENT (RFC 5545, Section 3.6.1 ) |
Parameter | key-value pairs inside of |
Property | key-value pairs inside of |
Todo |
Enums
CalendarDateTime | Representation of various forms of |
Class | Defines: |
EventStatus | Encodes the status of an |
TodoStatus | Encodes the status of a |
ValueType | see 8.3.4. Value Data Types Registry |
Traits
Component | Implemented by everything that goes into a |