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 find_latest_event_by_summary(
&self,
summary: &str,
) -> Result<Option<impl Event + 'static>, Box<dyn Error>>
pub async fn find_latest_event_by_summary( &self, summary: &str, ) -> Result<Option<impl Event + 'static>, Box<dyn Error>>
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 backend 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 backend 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, Box<dyn Error>>
pub async fn count_events( &self, conds: &EventConditions, ) -> Result<i64, Box<dyn Error>>
Sourcepub fn default_todo_draft(&self) -> Result<TodoDraft, String>
pub fn default_todo_draft(&self) -> Result<TodoDraft, String>
Sourcepub async fn find_latest_todo_by_summary(
&self,
summary: &str,
) -> Result<Option<impl Todo + 'static>, Box<dyn Error>>
pub async fn find_latest_todo_by_summary( &self, summary: &str, ) -> Result<Option<impl Todo + 'static>, Box<dyn Error>>
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 backend 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 a todo into the calendar.
§Errors
If the todo is not found, database or backend 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, Box<dyn Error>>
pub async fn count_todos( &self, conds: &TodoConditions, ) -> Result<i64, Box<dyn Error>>
Sourcepub async fn list_calendars(
&self,
) -> Result<Vec<CalendarRecord>, Box<dyn Error>>
pub async fn list_calendars( &self, ) -> Result<Vec<CalendarRecord>, Box<dyn Error>>
Sourcepub async fn get_calendar_details(
&self,
id: &str,
) -> Result<CalendarDetails, Box<dyn Error>>
pub async fn get_calendar_details( &self, id: &str, ) -> Result<CalendarDetails, Box<dyn Error>>
Get detailed information for a single calendar.
§Errors
If the calendar is not found or database access fails.
Sourcepub fn startup_notices(&self) -> &[String]
pub fn startup_notices(&self) -> &[String]
Startup notices produced while reconciling config and database state.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Aim
impl !UnwindSafe for Aim
impl Freeze for Aim
impl Send for Aim
impl Sync for Aim
impl Unpin for Aim
impl UnsafeUnpin 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
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
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>
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.