pub struct Aim { /* private fields */ }Expand description
AIM calendar application core.
Implementations§
Source§impl Aim
impl Aim
Sourcepub fn refresh_now(&mut self)
pub fn refresh_now(&mut self)
Refresh the current time to now.
Sourcepub fn default_event_draft(&self) -> EventDraft
pub fn default_event_draft(&self) -> EventDraft
Create a default event draft based on the AIM configuration.
Sourcepub async fn new_event(
&self,
draft: EventDraft,
) -> Result<impl Event + 'static, Box<dyn Error>>
pub async fn new_event( &self, draft: EventDraft, ) -> Result<impl Event + 'static, Box<dyn Error>>
Add a new event from the given draft.
§Errors
If the event is not found, database or file system access fails.
Sourcepub async fn update_event(
&self,
id: &Id,
patch: EventPatch,
) -> Result<impl Event + 'static, Box<dyn Error>>
pub async fn update_event( &self, id: &Id, patch: EventPatch, ) -> Result<impl Event + 'static, Box<dyn Error>>
Upsert an event into the calendar.
§Errors
If the event is not found, database or file system access fails.
Sourcepub async fn get_kind(&self, id: &Id) -> Result<Kind, Box<dyn Error>>
pub async fn get_kind(&self, id: &Id) -> Result<Kind, Box<dyn Error>>
Get the kind of the given id, which can be either an event or a todo.
§Errors
If the id is not found or database access fails.
Sourcepub async fn list_events(
&self,
conds: &EventConditions,
pager: &Pager,
) -> Result<Vec<impl Event + 'static>, Box<dyn Error>>
pub async fn list_events( &self, conds: &EventConditions, pager: &Pager, ) -> Result<Vec<impl Event + 'static>, Box<dyn Error>>
Sourcepub async fn count_events(&self, conds: &EventConditions) -> Result<i64, Error>
pub async fn count_events(&self, conds: &EventConditions) -> Result<i64, Error>
Sourcepub fn default_todo_draft(&self) -> TodoDraft
pub fn default_todo_draft(&self) -> TodoDraft
Create a default todo draft based on the AIM configuration.
Sourcepub async fn new_todo(
&self,
draft: TodoDraft,
) -> Result<impl Todo + 'static, Box<dyn Error>>
pub async fn new_todo( &self, draft: TodoDraft, ) -> Result<impl Todo + 'static, Box<dyn Error>>
Add a new todo from the given draft.
§Errors
If the todo is not found, database or file system access fails.
Sourcepub async fn update_todo(
&self,
id: &Id,
patch: TodoPatch,
) -> Result<impl Todo + 'static, Box<dyn Error>>
pub async fn update_todo( &self, id: &Id, patch: TodoPatch, ) -> Result<impl Todo + 'static, Box<dyn Error>>
Upsert an event into the calendar.
§Errors
If the todo is not found, database or file system access fails.
Sourcepub async fn list_todos(
&self,
conds: &TodoConditions,
sort: &[TodoSort],
pager: &Pager,
) -> Result<Vec<impl Todo + 'static>, Box<dyn Error>>
pub async fn list_todos( &self, conds: &TodoConditions, sort: &[TodoSort], pager: &Pager, ) -> Result<Vec<impl Todo + 'static>, Box<dyn Error>>
Sourcepub async fn count_todos(&self, conds: &TodoConditions) -> Result<i64, Error>
pub async fn count_todos(&self, conds: &TodoConditions) -> Result<i64, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Aim
impl !RefUnwindSafe for Aim
impl Send for Aim
impl Sync for Aim
impl Unpin for Aim
impl !UnwindSafe for Aim
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more