Skip to main content

ResolvedConfig

Struct ResolvedConfig 

Source
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_PATH, 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.

Issue #142: log_path is resolved from DOIGET_LOG_PATH — the ONLY log env var docs/CONFIG.md §4 documents — using the exact same resolution the provenance-log writer (commands::fetch::resolve_log_path / commands::audit_log) uses, so config show reports the path the writer actually uses. The previously read, undocumented DOIGET_LOG_DIR has been dropped.

Fields§

§store_root: Utf8PathBuf

Root of the on-disk paper store. Default: $HOME/papers.

§log_dir: Utf8PathBuf

Directory holding doiget’s append-only logs. Derived from log_path’s parent so it always agrees with the writer.

§log_path: Utf8PathBuf

JSON-Lines provenance log file path. DOIGET_LOG_PATH when set, otherwise <config_dir>/doiget/access.jsonl (docs/CONFIG.md §4).

§config_dir: Utf8PathBuf

Directory holding config.toml and credentials.toml.

§config_path: Utf8PathBuf

Path 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

Source

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.

Trait Implementations§

Source§

impl Debug for ResolvedConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for ResolvedConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more