pub struct Config {
pub calendar_path: Option<PathBuf>,
pub state_dir: Option<PathBuf>,
pub default_due: Option<DateTimeAnchor>,
pub default_priority: Priority,
pub default_priority_none_fist: bool,
pub config_dir: Option<PathBuf>,
pub dev_mode: bool,
pub stores: HashMap<String, StoreDef>,
pub calendars: Vec<CalendarEntry>,
pub default_calendar: String,
}Expand description
Configuration for the AIM application.
Fields§
§calendar_path: Option<PathBuf>Path to the calendar directory (optional ICS export/import).
Deprecated: Use calendars array instead.
If set, AIM will sync events/todos with ICS files in this directory.
If not set, AIM will only use the Db for storage.
state_dir: Option<PathBuf>Directory for storing application state.
default_due: Option<DateTimeAnchor>Default due time for new tasks.
default_priority: PriorityDefault priority for new tasks.
default_priority_none_fist: boolIf true, items with no priority will be listed first.
config_dir: Option<PathBuf>Parent directory of the config file.
Set by the CLI layer after parsing. Used by normalize() to resolve
relative paths against the config file location rather than the CWD.
dev_mode: boolWhether development mode is active.
When true, normalize() enforces explicit state_dir configuration
to prevent accidental use of the system default state directory.
stores: HashMap<String, StoreDef>Store definitions — shared connection configurations keyed by name.
calendars: Vec<CalendarEntry>Multi-calendar configuration.
If present, each entry references a store from stores.
default_calendar: StringDefault calendar ID for new items.
Implementations§
Source§impl Config
impl Config
Sourcepub fn is_legacy_format(&self) -> bool
pub fn is_legacy_format(&self) -> bool
Check if the configuration uses legacy single-calendar format.
Returns true if calendars array is empty (legacy or default mode).
Sourcepub fn legacy_warning(&self) -> String
pub fn legacy_warning(&self) -> String
Generate a warning message for legacy configuration.
This provides helpful guidance to users about migrating to multi-calendar format.
Sourcepub fn enabled_calendars(&self) -> Vec<&CalendarEntry>
pub fn enabled_calendars(&self) -> Vec<&CalendarEntry>
Get all enabled calendars ordered by priority.
Sourcepub fn resolve_store(
&self,
calendar_id: &str,
) -> Option<(&CalendarEntry, &StoreDef)>
pub fn resolve_store( &self, calendar_id: &str, ) -> Option<(&CalendarEntry, &StoreDef)>
Resolve the store definition for a calendar entry.
Returns None if the calendar is not found or the store reference is invalid.
Sourcepub fn get_calendar(&self, id: &str) -> Option<&CalendarEntry>
pub fn get_calendar(&self, id: &str) -> Option<&CalendarEntry>
Get a specific calendar entry by ID.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreimpl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
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.