eventkit 0.4.2

Safe Rust bindings for Apple's EventKit framework — events, reminders, calendars, sources, participants, structured locations, and virtual conference descriptors on macOS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use eventkit::prelude::*;

#[test]
fn calendar_draft_roundtrip_preserves_title() {
    let store = EKEventStore::new().expect("store");
    let draft = EKCalendarDraft::new(EKEntityType::Event, "Example Calendar");
    let roundtrip = draft.roundtrip(&store).expect("roundtrip");
    assert_eq!(roundtrip.title, "Example Calendar");
}

#[test]
fn calendar_draft_roundtrip_preserves_color() {
    let store = EKEventStore::new().expect("store");
    let mut draft = EKCalendarDraft::new(EKEntityType::Event, "Example Calendar");
    draft.color = Some("#FF8000FF".to_owned());
    let roundtrip = draft.roundtrip(&store).expect("roundtrip");
    assert_eq!(roundtrip.color.as_deref(), Some("#FF8000FF"));
}