Skip to main content

Module config

Module config 

Source
Expand description

Configuration: defaults, XDG TOML, env allowlist, CLI override.

Structs§

Config
Runtime configuration resolved from defaults, XDG TOML, env, and CLI.
ConfigInitResult
Result of config init.
ConfigPathData
Path inventory for config path (agent-readable).

Enums§

PathSource
Which layer won when resolving a storage path (XDG hierarchy diagnostics).

Constants§

APP_NAME
Product binary / crate name.
APP_VERSION
Package version from Cargo.
DEFAULT_CACHE_TTL_SECS
Default HTTP disk cache TTL (seconds).
DEFAULT_CONFIG_TOML
Default config.toml body written by config init (commented template).
DEFAULT_CONNECT_TIMEOUT_SECS
Default TCP connect timeout (seconds).
DEFAULT_MAX_BODY_BYTES
Default maximum downloaded response body size (bytes).
DEFAULT_MAX_CACHE_BYTES
Default HTTP disk cache budget in bytes (256 MiB). 0 = unlimited.
DEFAULT_MAX_OUTPUT_BYTES
Default maximum emitted stdout payload size (bytes).
DEFAULT_MAX_REDIRECTS
Default maximum HTTP redirects followed.
DEFAULT_MAX_RETRIES
Default maximum retries for transient HTTP errors.
DEFAULT_PER_PAGE
Default per_page for crates.io search.
DEFAULT_RATE_LIMIT_DELAY_MS
Default minimum delay between requests to the same host (milliseconds).
DEFAULT_RETRY_BASE_MS
Base backoff delay (milliseconds) for retries.
DEFAULT_RETRY_MAX_DELAY_MS
Default ceiling for a single retry sleep (milliseconds).
DEFAULT_SEARCH_LIMIT
Default hit limit for search-in-crate.
DEFAULT_TIMEOUT_SECS
Default wall-clock timeout (seconds) for one operation.
HARD_MAX_BODY_BYTES
Hard ceiling for HTTP body size (CLI / TOML / env cannot raise above this).
HARD_MAX_OUTPUT_BYTES
Hard ceiling for emitted stdout payload size (CLI / TOML / env cannot raise above).
HOST_CRATES_IO
crates.io host allowlist entry.
HOST_DOCS_RS
docs.rs host allowlist entry.
HOST_DOC_RUST_LANG_ORG
Official stdlib rustdoc host (std / core / alloc).
HOST_STATIC_DOCS_RS
static.docs.rs host allowlist entry (redirects).
MAX_CRATE_NAME_CHARS
Maximum crate name length.
MAX_ITEM_PATH_CHARS
Maximum rustdoc item path length.
MAX_PER_PAGE
Maximum per_page accepted for crates.io search.
MAX_QUERY_CHARS
Maximum query string length.
MAX_SEARCH_IN_CRATE_LIMIT
Maximum hit limit for search-in-crate.
MAX_USER_AGENT_CHARS
Maximum User-Agent length.
MAX_VERSION_CHARS
Maximum version string length.
MSRV
Minimum supported Rust version.
SCHEMA_VERSION
JSON envelope schema_version constant.

Functions§

config_path_data
Build path inventory from a loaded Config.
config_toml_under
Ensure path is under a directory (used by tests / path display).
default_user_agent
Builds the default User-Agent, optionally including a contact token.
docs_origin_for_crate
Resolve docs origin for a crate: stdlib → doc.rust-lang.org, else configured docs.rs origin.
init_config_toml
Create default config.toml under the resolved config directory.
is_stdlib_crate
True for Rust standard library crates documented on doc.rust-lang.org.
normalize_origin
Strip trailing slash from an origin base URL.
resolve_config_dir
Resolve config directory: CLI/env override, then DOCSRS_CLI_HOME/config, then XDG.
resolve_config_dir_with_source
Resolve config directory and report which layer won.
resolve_version_arg
Resolve version argument: latest or SemVer without v prefix / build metadata.
stdlib_channel
Map CLI version token to a rustdoc channel for stdlib paths.
validate_crate_name
Validate crate name (compat wrapper over crate::domain::CrateName::parse).
validate_item_path
Validate item path (compat wrapper over crate::domain::ItemPath::parse).
validate_query
Validate search query (compat wrapper over crate::domain::SearchQuery::parse).