pub struct CalendarApi {
pub engine: Arc<CalendarEngine>,
/* private fields */
}Expand description
Calendar API facade — 15th typed API in [KernelHandle].
Delegates all operations to the underlying CalendarEngine
and publishes KernelEvent variants for each mutation.
Constructed during kernel assembly and stored in KernelHandle.calendar.
Fields§
§engine: Arc<CalendarEngine>The calendar engine.
Implementations§
Source§impl CalendarApi
impl CalendarApi
Sourcepub fn new(engine: Arc<CalendarEngine>) -> Self
pub fn new(engine: Arc<CalendarEngine>) -> Self
Create a new CalendarApi wrapping the given engine.
Sourcepub fn with_event_bus(engine: Arc<CalendarEngine>, event_bus: EventBus) -> Self
pub fn with_event_bus(engine: Arc<CalendarEngine>, event_bus: EventBus) -> Self
Create a new CalendarApi with event bus support.
Sourcepub async fn create(&self, draft: EventDraft) -> Result<CreateResult>
pub async fn create(&self, draft: EventDraft) -> Result<CreateResult>
Create a new event and publish a CalendarEventCreated event.
Sourcepub async fn update(&self, uid: &str, patch: EventPatch) -> Result<UpdateResult>
pub async fn update(&self, uid: &str, patch: EventPatch) -> Result<UpdateResult>
Update an existing event and publish a CalendarEventUpdated event.
Sourcepub async fn delete(&self, uid: &str) -> Result<()>
pub async fn delete(&self, uid: &str) -> Result<()>
Delete an event by UID and publish a CalendarEventDeleted event.
Sourcepub async fn list(
&self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Result<Vec<Event>>
pub async fn list( &self, from: DateTime<Utc>, to: DateTime<Utc>, ) -> Result<Vec<Event>>
List events in a time range [from, to).
Sourcepub async fn freebusy(
&self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Result<Vec<FreeBusySlot>>
pub async fn freebusy( &self, from: DateTime<Utc>, to: DateTime<Utc>, ) -> Result<Vec<FreeBusySlot>>
Compute free/busy slots in a time range.
Sourcepub fn find_pending_alarms(
&self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Vec<AlarmEvent>
pub fn find_pending_alarms( &self, from: DateTime<Utc>, to: DateTime<Utc>, ) -> Vec<AlarmEvent>
Find pending alarms in a time range.
Auto Trait Implementations§
impl !RefUnwindSafe for CalendarApi
impl !UnwindSafe for CalendarApi
impl Freeze for CalendarApi
impl Send for CalendarApi
impl Sync for CalendarApi
impl Unpin for CalendarApi
impl UnsafeUnpin for CalendarApi
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