eventkit/lib.rs
1//! # EventKit-RS
2//!
3//! A Rust library for interacting with macOS Calendar and Reminders via EventKit.
4//!
5//! This library provides safe wrappers around the Apple EventKit framework to:
6//! - Request and check authorization for calendar and reminders access
7//! - List, create, update, and delete calendar events
8//! - List, create, update, and delete reminders
9//! - Manage calendars and reminder lists
10//!
11//! ## Quick Start
12//!
13//! ```rust,no_run
14//! use eventkit::{RemindersManager, EventsManager, Result};
15//!
16//! fn main() -> Result<()> {
17//! // Working with reminders
18//! let reminders = RemindersManager::new();
19//! reminders.request_access()?;
20//!
21//! for reminder in reminders.fetch_incomplete_reminders()? {
22//! println!("Todo: {}", reminder.title);
23//! }
24//!
25//! // Working with calendar events
26//! let events = EventsManager::new();
27//! events.request_access()?;
28//!
29//! for event in events.fetch_today_events()? {
30//! println!("Event: {}", event.title);
31//! }
32//!
33//! Ok(())
34//! }
35//! ```
36//!
37//! ## Platform Support
38//!
39//! This library only works on macOS. It requires macOS 10.14 or later for full functionality.
40//!
41//! ## Privacy Permissions
42//!
43//! Your application will need to request calendar and/or reminders permissions.
44//! Make sure to include the appropriate keys in your `Info.plist`:
45//!
46//! - `NSRemindersUsageDescription` - for reminders access
47//! - `NSCalendarsFullAccessUsageDescription` - for calendar access (macOS 14+)
48//! - `NSCalendarsUsageDescription` - for calendar access (older macOS)
49
50// This entire crate is macOS-only (EventKit framework). On other platforms it
51// compiles as an empty shell so that `cargo build --workspace` works everywhere.
52// Dependents gate their eventkit usage with `#[cfg(target_os = "macos")]`.
53
54#[cfg(target_os = "macos")]
55mod imp;
56#[cfg(target_os = "macos")]
57pub use imp::*;