pub struct RemindersManager { /* private fields */ }Expand description
The main reminders manager providing access to EventKit functionality
Implementations§
Source§impl RemindersManager
impl RemindersManager
Gets the current authorization status for reminders
Sourcepub fn request_access(&self) -> Result<bool>
pub fn request_access(&self) -> Result<bool>
Requests full access to reminders (blocking)
Returns Ok(true) if access was granted, Ok(false) if denied
Ensures we have authorization, requesting if needed
Sourcepub fn list_calendars(&self) -> Result<Vec<CalendarInfo>>
pub fn list_calendars(&self) -> Result<Vec<CalendarInfo>>
Lists all reminder calendars (lists)
Sourcepub fn list_sources(&self) -> Result<Vec<SourceInfo>>
pub fn list_sources(&self) -> Result<Vec<SourceInfo>>
Lists all available sources (iCloud, Local, Exchange, etc.)
Sourcepub fn default_calendar(&self) -> Result<CalendarInfo>
pub fn default_calendar(&self) -> Result<CalendarInfo>
Gets the default calendar for new reminders
Sourcepub fn fetch_all_reminders(&self) -> Result<Vec<ReminderItem>>
pub fn fetch_all_reminders(&self) -> Result<Vec<ReminderItem>>
Fetches all reminders (blocking)
Sourcepub fn fetch_reminders(
&self,
calendar_titles: Option<&[&str]>,
) -> Result<Vec<ReminderItem>>
pub fn fetch_reminders( &self, calendar_titles: Option<&[&str]>, ) -> Result<Vec<ReminderItem>>
Fetches reminders from specific calendars (blocking)
Sourcepub fn fetch_incomplete_reminders(&self) -> Result<Vec<ReminderItem>>
pub fn fetch_incomplete_reminders(&self) -> Result<Vec<ReminderItem>>
Fetches incomplete reminders (no due-date filter, all calendars).
Sourcepub fn fetch_incomplete_reminders_in_due_range(
&self,
starting: Option<DateTime<Local>>,
ending: Option<DateTime<Local>>,
calendar_titles: Option<&[&str]>,
) -> Result<Vec<ReminderItem>>
pub fn fetch_incomplete_reminders_in_due_range( &self, starting: Option<DateTime<Local>>, ending: Option<DateTime<Local>>, calendar_titles: Option<&[&str]>, ) -> Result<Vec<ReminderItem>>
Fetches incomplete reminders whose due date falls within the optional
starting..ending window. Either bound may be None to leave it
open-ended. calendar_titles filters to specific lists (passing
None searches all reminder calendars).
Sourcepub fn fetch_completed_reminders_in_range(
&self,
starting: Option<DateTime<Local>>,
ending: Option<DateTime<Local>>,
calendar_titles: Option<&[&str]>,
) -> Result<Vec<ReminderItem>>
pub fn fetch_completed_reminders_in_range( &self, starting: Option<DateTime<Local>>, ending: Option<DateTime<Local>>, calendar_titles: Option<&[&str]>, ) -> Result<Vec<ReminderItem>>
Fetches completed reminders whose completion date falls within the
optional starting..ending window. Either bound may be None.
calendar_titles filters to specific lists.
Sourcepub fn create_reminder(&self, draft: &ReminderDraft<'_>) -> Result<ReminderItem>
pub fn create_reminder(&self, draft: &ReminderDraft<'_>) -> Result<ReminderItem>
Creates a new reminder. Build the input with ReminderDraft —
only title is required; spread ..Default::default() for the rest.
Sourcepub fn update_reminder(
&self,
identifier: &str,
patch: &ReminderPatch<'_>,
) -> Result<ReminderItem>
pub fn update_reminder( &self, identifier: &str, patch: &ReminderPatch<'_>, ) -> Result<ReminderItem>
Updates an existing reminder. Build the changeset with ReminderPatch
— only set the fields you want to touch. For nullable string/timezone
fields, Some(Some(v)) writes v and Some(None) clears.
Sourcepub fn complete_reminder(&self, identifier: &str) -> Result<ReminderItem>
pub fn complete_reminder(&self, identifier: &str) -> Result<ReminderItem>
Marks a reminder as complete
Sourcepub fn uncomplete_reminder(&self, identifier: &str) -> Result<ReminderItem>
pub fn uncomplete_reminder(&self, identifier: &str) -> Result<ReminderItem>
Marks a reminder as incomplete
Sourcepub fn delete_reminder(&self, identifier: &str) -> Result<()>
pub fn delete_reminder(&self, identifier: &str) -> Result<()>
Deletes a reminder
Sourcepub fn get_reminder(&self, identifier: &str) -> Result<ReminderItem>
pub fn get_reminder(&self, identifier: &str) -> Result<ReminderItem>
Gets a reminder by its identifier
Sourcepub fn dump_reminder_raw(
&self,
identifier: &str,
read_values: bool,
) -> Result<String>
pub fn dump_reminder_raw( &self, identifier: &str, read_values: bool, ) -> Result<String>
Dumps every Objective-C @property declared on the reminder, its
EKCalendar, and that calendar’s EKSource — using runtime reflection
(class_copyPropertyList). Intended for figuring out which native
fields are not yet surfaced by ReminderItem.
If read_values is true, also reads each property via KVC
(valueForKey:). Some properties in EventKit are backed by Core Data
internals and hit C-level assertions when read this way — see the
hardcoded denylist in reflect_object_full. Use false for a fully
safe schema-only listing.
Sourcepub fn dump_reminder_private(&self, identifier: &str) -> Result<String>
pub fn dump_reminder_private(&self, identifier: &str) -> Result<String>
Probes a hardcoded list of suspected-private selectors on the reminder
— the kind of accessors that aren’t generated by objc2-event-kit
and reject KVC valueForKey: (e.g. structuredData, tags,
richLink). Each call is wrapped in an Objective-C exception catch.
Read-only — never invokes any setter.
Sourcepub fn get_alarms(&self, identifier: &str) -> Result<Vec<AlarmInfo>>
pub fn get_alarms(&self, identifier: &str) -> Result<Vec<AlarmInfo>>
Lists all alarms on a reminder.
Sourcepub fn add_alarm(&self, identifier: &str, alarm: &AlarmInfo) -> Result<()>
pub fn add_alarm(&self, identifier: &str, alarm: &AlarmInfo) -> Result<()>
Adds an alarm to a reminder.
Sourcepub fn remove_all_alarms(&self, identifier: &str) -> Result<()>
pub fn remove_all_alarms(&self, identifier: &str) -> Result<()>
Removes all alarms from a reminder.
Sourcepub fn remove_alarm(&self, identifier: &str, index: usize) -> Result<()>
pub fn remove_alarm(&self, identifier: &str, index: usize) -> Result<()>
Removes a specific alarm from a reminder by index.
Sourcepub fn set_URL(&self, identifier: &str, url: Option<&str>) -> Result<()>
pub fn set_URL(&self, identifier: &str, url: Option<&str>) -> Result<()>
Set or clear the URL on a reminder.
Sourcepub fn set_location(
&self,
identifier: &str,
location: Option<&str>,
) -> Result<()>
pub fn set_location( &self, identifier: &str, location: Option<&str>, ) -> Result<()>
Set or clear the free-text location on a reminder.
Sourcepub fn set_due_date_timezone(
&self,
identifier: &str,
tz_name: Option<&str>,
) -> Result<()>
pub fn set_due_date_timezone( &self, identifier: &str, tz_name: Option<&str>, ) -> Result<()>
Set or clear EKReminder.dueDateTimeZone. tz_name must be an
IANA zone identifier (e.g. "America/Los_Angeles").
Sourcepub fn set_structured_location(
&self,
identifier: &str,
loc: Option<&StructuredLocation>,
) -> Result<()>
pub fn set_structured_location( &self, identifier: &str, loc: Option<&StructuredLocation>, ) -> Result<()>
Set (or clear) the reminder’s rich location — EKReminder.structuredLocation
(not in objc2-event-kit 0.3 generated bindings — accessed via
msg_send!).
iCloud caveat: verified empirically — iCloud silently drops this
mutation on reminder objects even though the save returns success.
Use set_geofence instead for iCloud-synced
reminders; it writes the structured location on a proximity alarm,
which iCloud does persist. This method remains correct for local /
non-iCloud reminder sources.
Sourcepub fn set_geofence(
&self,
identifier: &str,
geofence: Option<(&StructuredLocation, AlarmProximity)>,
) -> Result<()>
pub fn set_geofence( &self, identifier: &str, geofence: Option<(&StructuredLocation, AlarmProximity)>, ) -> Result<()>
Attach (or clear) a geofence on the reminder. Implemented as a
location-based EKAlarm since EventKit has no structuredLocation
directly on EKReminder / EKCalendarItem. When geofence is
Some, also requests WhenInUse location authorization so the alarm
actually has permission to fire — if the user denies, the save is
aborted with an authorization error.
Sourcepub fn get_recurrence_rules(
&self,
identifier: &str,
) -> Result<Vec<RecurrenceRule>>
pub fn get_recurrence_rules( &self, identifier: &str, ) -> Result<Vec<RecurrenceRule>>
Gets recurrence rules on a reminder.
Sourcepub fn set_recurrence_rule(
&self,
identifier: &str,
rule: &RecurrenceRule,
) -> Result<()>
pub fn set_recurrence_rule( &self, identifier: &str, rule: &RecurrenceRule, ) -> Result<()>
Sets a recurrence rule on a reminder (replaces any existing rules).
Sourcepub fn remove_recurrence_rules(&self, identifier: &str) -> Result<()>
pub fn remove_recurrence_rules(&self, identifier: &str) -> Result<()>
Removes all recurrence rules from a reminder.
Sourcepub fn create_calendar(&self, title: &str) -> Result<CalendarInfo>
pub fn create_calendar(&self, title: &str) -> Result<CalendarInfo>
Creates a new reminder list (calendar)
The list will be created in the default source (usually iCloud or Local).
Sourcepub fn rename_calendar(
&self,
identifier: &str,
new_title: &str,
) -> Result<CalendarInfo>
pub fn rename_calendar( &self, identifier: &str, new_title: &str, ) -> Result<CalendarInfo>
Renames an existing reminder list (calendar) Rename a reminder list (backward compat wrapper).
Sourcepub fn update_calendar(
&self,
identifier: &str,
new_title: Option<&str>,
color_rgba: Option<(f64, f64, f64, f64)>,
) -> Result<CalendarInfo>
pub fn update_calendar( &self, identifier: &str, new_title: Option<&str>, color_rgba: Option<(f64, f64, f64, f64)>, ) -> Result<CalendarInfo>
Update a reminder list — name, color, or both.
Sourcepub fn delete_calendar(&self, identifier: &str) -> Result<()>
pub fn delete_calendar(&self, identifier: &str) -> Result<()>
Deletes a reminder list (calendar)
Warning: This will delete all reminders in the list!
Sourcepub fn get_calendar(&self, identifier: &str) -> Result<CalendarInfo>
pub fn get_calendar(&self, identifier: &str) -> Result<CalendarInfo>
Gets a calendar by its identifier