pub struct EventsManager { /* private fields */ }Expand description
The events manager providing access to Calendar events via EventKit
Implementations§
Source§impl EventsManager
impl EventsManager
Gets the current authorization status for calendar events
Sourcepub fn request_access(&self) -> Result<bool>
pub fn request_access(&self) -> Result<bool>
Requests full access to calendar events (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 event calendars
Sourcepub fn default_calendar(&self) -> Result<CalendarInfo>
pub fn default_calendar(&self) -> Result<CalendarInfo>
Gets the default calendar for new events
Sourcepub fn fetch_today_events(&self) -> Result<Vec<EventItem>>
pub fn fetch_today_events(&self) -> Result<Vec<EventItem>>
Fetches events for today
Sourcepub fn fetch_upcoming_events(&self, days: i64) -> Result<Vec<EventItem>>
pub fn fetch_upcoming_events(&self, days: i64) -> Result<Vec<EventItem>>
Fetches events for the next N days
Sourcepub fn fetch_events(
&self,
start: DateTime<Local>,
end: DateTime<Local>,
calendar_titles: Option<&[&str]>,
) -> Result<Vec<EventItem>>
pub fn fetch_events( &self, start: DateTime<Local>, end: DateTime<Local>, calendar_titles: Option<&[&str]>, ) -> Result<Vec<EventItem>>
Fetches events in a date range
Sourcepub fn create_event(
&self,
title: &str,
start: DateTime<Local>,
end: DateTime<Local>,
notes: Option<&str>,
location: Option<&str>,
calendar_title: Option<&str>,
all_day: bool,
) -> Result<EventItem>
pub fn create_event( &self, title: &str, start: DateTime<Local>, end: DateTime<Local>, notes: Option<&str>, location: Option<&str>, calendar_title: Option<&str>, all_day: bool, ) -> Result<EventItem>
Creates a new event
Sourcepub fn update_event(
&self,
identifier: &str,
title: Option<&str>,
notes: Option<&str>,
location: Option<&str>,
start: Option<DateTime<Local>>,
end: Option<DateTime<Local>>,
) -> Result<EventItem>
pub fn update_event( &self, identifier: &str, title: Option<&str>, notes: Option<&str>, location: Option<&str>, start: Option<DateTime<Local>>, end: Option<DateTime<Local>>, ) -> Result<EventItem>
Updates an existing event
Sourcepub fn delete_event(&self, identifier: &str) -> Result<()>
pub fn delete_event(&self, identifier: &str) -> Result<()>
Deletes an event
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventsManager
impl !RefUnwindSafe for EventsManager
impl !Send for EventsManager
impl !Sync for EventsManager
impl Unpin for EventsManager
impl !UnwindSafe for EventsManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more