pub struct AppConfig {
pub log_dir: Option<PathBuf>,
pub log_dir_source: LogDirSource,
pub log_enabled: bool,
pub prompt_preview_chars: usize,
/* private fields */
}Expand description
Application-wide configuration resolved from environment variables.
Log directory resolution order:
ALC_LOG_DIRenv var (explicit override)~/.algocline/logs(home-based default)$XDG_STATE_HOME/algocline/logsor~/.local/state/algocline/logs- Current working directory (sandbox fallback)
None— stderr-only mode (no file logging)
Application root directory resolution:
ALC_HOMEenv var (explicit override — same pattern asCARGO_HOME/RUSTUP_HOME).~/.algocline/— home-based default../.algocline/— fallback whenHOMEis not available (unusual).
ALC_LOG_LEVEL:full(default) oroff.ALC_PROMPT_PREVIEW_CHARS: char count foralc_status(pending_filter="preview")prompt truncation. Falls back toalgocline_engine::DEFAULT_PROMPT_PREVIEW_CHARSwhen unset or unparseable. Setting0yields empty previews — if you want no prompt at all, use the"meta"preset instead.
Fields§
§log_dir: Option<PathBuf>Resolved log directory, or None if no writable directory is available.
log_dir_source: LogDirSource§log_enabled: bool§prompt_preview_chars: usizeChar count for alc_status prompt_preview truncation.
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn with_app_dir(self, root: PathBuf) -> Self
pub fn with_app_dir(self, root: PathBuf) -> Self
Override the application root directory — intended for tests that
need to redirect every ~/.algocline/ access to a tempdir.
Sourcepub fn resolve_home() -> Option<PathBuf>
pub fn resolve_home() -> Option<PathBuf>
Resolve the user’s home directory for facilities that legitimately
need real ~ access (e.g. ~/.ssh/ key detection in
gh_credentials::check_ssh_keys).
This is the single Service-layer HOME-read site aside from
Self::resolve_app_dir itself. Every other caller in
crates/algocline-app/src/service/** MUST route through this fn
(or resolve_app_dir / AppDir) so check-invariants Inv-1
keeps a single-source-of-truth whitelist. Returns None on
sandboxes where HOME cannot be resolved (mirroring
resolve_app_dir’s fallback path).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnsafeUnpin for AppConfig
impl UnwindSafe for AppConfig
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,
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> MaybeSend for Twhere
T: Send,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.