Expand description
§EventKit-RS
A Rust library for interacting with macOS Calendar and Reminders via EventKit.
This library provides safe wrappers around the Apple EventKit framework to:
- Request and check authorization for calendar and reminders access
- List, create, update, and delete calendar events
- List, create, update, and delete reminders
- Manage calendars and reminder lists
§Quick Start
use eventkit::{RemindersManager, EventsManager, Result};
fn main() -> Result<()> {
// Working with reminders
let reminders = RemindersManager::new();
reminders.request_access()?;
for reminder in reminders.fetch_incomplete_reminders()? {
println!("Todo: {}", reminder.title);
}
// Working with calendar events
let events = EventsManager::new();
events.request_access()?;
for event in events.fetch_today_events()? {
println!("Event: {}", event.title);
}
Ok(())
}§Platform Support
This library only works on macOS. It requires macOS 10.14 or later for full functionality.
§Privacy Permissions
Your application will need to request calendar and/or reminders permissions.
Make sure to include the appropriate keys in your Info.plist:
NSRemindersUsageDescription- for reminders accessNSCalendarsFullAccessUsageDescription- for calendar access (macOS 14+)NSCalendarsUsageDescription- for calendar access (older macOS)
Modules§
Structs§
- Alarm
Info - An alarm attached to a reminder or event.
- Calendar
Info - Represents a calendar (reminder list or event calendar).
- Event
Draft - Input for
EventsManager::create_event. Onlytitle,start, andendare required; spread..Default::default()for the rest. MirrorsReminderDraftfor consistency. - Event
Item - Represents a calendar event with its properties.
- Event
Patch - Input for
EventsManager::update_event. Each field uses one of:None(don’t touch),Some(value)(set). Nullable fields useOption<Option<T>>soSome(None)clears the value.spancontrols whether the edit applies to just this occurrence or all future ones in a recurring series. - Events
Manager - The events manager providing access to Calendar events via EventKit
- Participant
Info - A participant (attendee) on an event or reminder.
- Recurrence
Rule - A recurrence rule describing how a reminder or event repeats.
- Reminder
Draft - Input for
RemindersManager::create_reminder. All fields excepttitleare optional. Use..Default::default()for the unset ones. - Reminder
Item - Represents a reminder item with its properties
- Reminder
Patch - Input for
RemindersManager::update_reminder. Each field uses one of:None(don’t touch),Some(value)(set), and forOption<Option<T>>fields,Some(None)(clear). Build with..Default::default(). - Reminders
Manager - The main reminders manager providing access to EventKit functionality
- Source
Info - An account source (iCloud, Local, Exchange, etc.)
- Structured
Location - A structured location for geofenced alarms.
Enums§
- Alarm
Proximity - Proximity trigger for a location-based alarm.
- Alarm
Type - EKAlarm.type — derived by Apple from which optional fields are set:
soundName→ Audio,url→ Procedure,emailAddress→ Email, else Display. - Authorization
Status - Authorization status for reminders access
- Calendar
Type - Type of calendar/source.
- Event
Availability - Event availability for scheduling.
- Event
KitError - Errors that can occur when working with EventKit
- Event
Span - Scope of a recurring-event edit or delete — mirrors Apple’s
EKSpan. - Event
Status - Event status.
- Participant
Role - Participant role in an event.
- Participant
Status - Participant RSVP status.
- Recurrence
EndCondition - When a recurrence ends.
- Recurrence
Frequency - How often a recurrence repeats.
Type Aliases§
- Reminders
Error - Backward compatibility alias
- Result
- Result type for EventKit operations