pub struct Aim { /* private fields */ }Expand description
AIM calendar application core.
Implementations§
Source§impl Aim
impl Aim
Sourcepub async fn new(config: &Config) -> Result<Self, Box<dyn Error>>
pub async fn new(config: &Config) -> Result<Self, Box<dyn Error>>
Creates a new AIM instance with the given configuration.
Sourcepub async fn list_events(
&self,
conds: &EventConditions,
pager: &Pager,
) -> Result<Vec<impl Event>, Error>
pub async fn list_events( &self, conds: &EventConditions, pager: &Pager, ) -> Result<Vec<impl Event>, Error>
List events matching the given conditions.
Sourcepub async fn count_events(&self, conds: &EventConditions) -> Result<i64, Error>
pub async fn count_events(&self, conds: &EventConditions) -> Result<i64, Error>
Counts the number of events matching the given conditions.
Sourcepub async fn new_todo(
&self,
draft: TodoDraft,
) -> Result<impl Todo, Box<dyn Error>>
pub async fn new_todo( &self, draft: TodoDraft, ) -> Result<impl Todo, Box<dyn Error>>
Add a new todo from the given draft.
Sourcepub async fn update_todo(
&self,
patch: TodoPatch,
) -> Result<impl Todo, Box<dyn Error>>
pub async fn update_todo( &self, patch: TodoPatch, ) -> Result<impl Todo, Box<dyn Error>>
Upsert an event into the calendar.
Sourcepub async fn get_todo(&self, uid: &str) -> Result<Option<impl Todo>, Error>
pub async fn get_todo(&self, uid: &str) -> Result<Option<impl Todo>, Error>
Get a todo by its UID.
Sourcepub async fn list_todos(
&self,
conds: &TodoConditions,
sort: &[TodoSort],
pager: &Pager,
) -> Result<Vec<impl Todo>, Error>
pub async fn list_todos( &self, conds: &TodoConditions, sort: &[TodoSort], pager: &Pager, ) -> Result<Vec<impl Todo>, Error>
List todos matching the given conditions, sorted and paginated.
Sourcepub async fn count_todos(&self, conds: &TodoConditions) -> Result<i64, Error>
pub async fn count_todos(&self, conds: &TodoConditions) -> Result<i64, Error>
Counts the number of todos matching the given conditions.
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