Skip to main content

RemindersManager

Struct RemindersManager 

Source
pub struct RemindersManager { /* private fields */ }
Expand description

The main reminders manager providing access to EventKit functionality

Implementations§

Source§

impl RemindersManager

Source

pub fn new() -> Self

Creates a new RemindersManager instance

Source

pub fn authorization_status() -> AuthorizationStatus

Gets the current authorization status for reminders

Source

pub fn request_access(&self) -> Result<bool>

Requests full access to reminders (blocking)

Returns Ok(true) if access was granted, Ok(false) if denied

Source

pub fn ensure_authorized(&self) -> Result<()>

Ensures we have authorization, requesting if needed

Source

pub fn list_calendars(&self) -> Result<Vec<CalendarInfo>>

Lists all reminder calendars (lists)

Source

pub fn list_sources(&self) -> Result<Vec<SourceInfo>>

Lists all available sources (iCloud, Local, Exchange, etc.)

Source

pub fn default_calendar(&self) -> Result<CalendarInfo>

Gets the default calendar for new reminders

Source

pub fn fetch_all_reminders(&self) -> Result<Vec<ReminderItem>>

Fetches all reminders (blocking)

Source

pub fn fetch_reminders( &self, calendar_titles: Option<&[&str]>, ) -> Result<Vec<ReminderItem>>

Fetches reminders from specific calendars (blocking)

Source

pub fn fetch_incomplete_reminders(&self) -> Result<Vec<ReminderItem>>

Fetches incomplete reminders (no due-date filter, all calendars).

Source

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).

Source

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.

Source

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.

Source

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.

Source

pub fn complete_reminder(&self, identifier: &str) -> Result<ReminderItem>

Marks a reminder as complete

Source

pub fn uncomplete_reminder(&self, identifier: &str) -> Result<ReminderItem>

Marks a reminder as incomplete

Source

pub fn delete_reminder(&self, identifier: &str) -> Result<()>

Deletes a reminder

Source

pub fn get_reminder(&self, identifier: &str) -> Result<ReminderItem>

Gets a reminder by its identifier

Source

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.

Source

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.

Source

pub fn get_alarms(&self, identifier: &str) -> Result<Vec<AlarmInfo>>

Lists all alarms on a reminder.

Source

pub fn add_alarm(&self, identifier: &str, alarm: &AlarmInfo) -> Result<()>

Adds an alarm to a reminder.

Source

pub fn remove_all_alarms(&self, identifier: &str) -> Result<()>

Removes all alarms from a reminder.

Source

pub fn remove_alarm(&self, identifier: &str, index: usize) -> Result<()>

Removes a specific alarm from a reminder by index.

Source

pub fn set_URL(&self, identifier: &str, url: Option<&str>) -> Result<()>

Set or clear the URL on a reminder.

Source

pub fn set_location( &self, identifier: &str, location: Option<&str>, ) -> Result<()>

Set or clear the free-text location on a reminder.

Source

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").

Source

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.

Source

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.

Source

pub fn get_recurrence_rules( &self, identifier: &str, ) -> Result<Vec<RecurrenceRule>>

Gets recurrence rules on a reminder.

Source

pub fn set_recurrence_rule( &self, identifier: &str, rule: &RecurrenceRule, ) -> Result<()>

Sets a recurrence rule on a reminder (replaces any existing rules).

Source

pub fn remove_recurrence_rules(&self, identifier: &str) -> Result<()>

Removes all recurrence rules from a reminder.

Source

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).

Source

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).

Source

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.

Source

pub fn delete_calendar(&self, identifier: &str) -> Result<()>

Deletes a reminder list (calendar)

Warning: This will delete all reminders in the list!

Source

pub fn get_calendar(&self, identifier: &str) -> Result<CalendarInfo>

Gets a calendar by its identifier

Trait Implementations§

Source§

impl Default for RemindersManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,