pub struct ResolvedConfig {
pub store_root: Utf8PathBuf,
pub log_dir: Utf8PathBuf,
pub log_path: Utf8PathBuf,
pub config_dir: Utf8PathBuf,
pub config_path: Utf8PathBuf,
pub contact_email: Option<String>,
pub unpaywall_email: Option<String>,
}Expand description
Snapshot of the env-var + default-fallback config that doiget would
use on the current machine.
Phase 1 surface: env vars only (DOIGET_STORE_ROOT, DOIGET_LOG_DIR,
DOIGET_CONTACT_EMAIL, DOIGET_UNPAYWALL_EMAIL) layered over
XDG / known-folder defaults. Phase 2 will layer the user config.toml
underneath the env vars per docs/CONFIG.md §1.
Fields§
§store_root: Utf8PathBufRoot of the on-disk paper store. Default: $HOME/papers.
log_dir: Utf8PathBufDirectory holding doiget’s append-only logs.
log_path: Utf8PathBufJSON-Lines provenance log file path. Always <log_dir>/access.jsonl.
config_dir: Utf8PathBufDirectory holding config.toml and credentials.toml.
config_path: Utf8PathBufPath of the user config file (may not exist on disk yet).
contact_email: Option<String>Contact email for the polite User-Agent header (and Unpaywall fallback).
unpaywall_email: Option<String>Unpaywall-specific contact email; falls back to contact_email when unset.
Implementations§
Source§impl ResolvedConfig
impl ResolvedConfig
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Resolve the live config from process environment + platform defaults.
Errors only if neither a home directory nor a config directory can
be determined for the current user (e.g. an unknown / locked-down
platform); on every realistic POSIX or Windows host this returns
Ok even with no DOIGET_* env vars set.