EventsManager

Struct EventsManager 

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

The events manager providing access to Calendar events via EventKit

Implementations§

Source§

impl EventsManager

Source

pub fn new() -> Self

Creates a new EventsManager instance

Source

pub fn authorization_status() -> AuthorizationStatus

Gets the current authorization status for calendar events

Source

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

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 event calendars

Source

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

Gets the default calendar for new events

Source

pub fn fetch_today_events(&self) -> Result<Vec<EventItem>>

Fetches events for today

Source

pub fn fetch_upcoming_events(&self, days: i64) -> Result<Vec<EventItem>>

Fetches events for the next N days

Source

pub fn fetch_events( &self, start: DateTime<Local>, end: DateTime<Local>, calendar_titles: Option<&[&str]>, ) -> Result<Vec<EventItem>>

Fetches events in a date range

Source

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

Source

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

Source

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

Deletes an event

Source

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

Gets an event by its identifier

Trait Implementations§

Source§

impl Default for EventsManager

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, 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> AutoreleaseSafe for T
where T: ?Sized,