Expand description
Core crate for the OrthoConfig configuration framework.
Defines the OrthoConfig trait, error types and sanitization helpers used
to layer configuration from the CLI, files and environment. The derive macro
lives in the companion ortho_config_macros crate.
Re-exports§
pub use crate::subcommand::SubcmdConfigMerge;serde_jsonpub use agent_context::json::serialize_agent_context;serde_jsonpub use agent_context::json::serialize_agent_context_pretty;serde_jsonpub use agent_context::AGENT_CONTEXT_KIND_SUFFIX;pub use agent_context::AgentCommand;pub use agent_context::AgentContext;pub use agent_context::AgentExample;pub use agent_context::AgentInput;pub use agent_context::AgentPolicy;pub use agent_context::AsyncSubmission;pub use agent_context::AsyncSubmissionMode;pub use agent_context::DeliveryRoute;pub use agent_context::InteractionMode;pub use agent_context::MutationEffect;pub use agent_context::ORTHO_AGENT_CONTEXT_SCHEMA_VERSION;pub use agent_context::PaginationContract;pub use agent_context::PolicyMode;pub use agent_context::SkillCommandRef;pub use agent_context::SkillManifest;pub use agent_context::SupportDeclaration;pub use agent_context::agent_context_kind;pub use docs::CliMetadata;pub use docs::ConfigDiscoveryMeta;pub use docs::ConfigFormat;pub use docs::DefaultValue;pub use docs::Deprecation;pub use docs::DocMetadata;pub use docs::EnvMetadata;pub use docs::Example;pub use docs::FieldMetadata;pub use docs::FileMetadata;pub use docs::HeadingIds;pub use docs::Link;pub use docs::Note;pub use docs::ORTHO_DOCS_IR_VERSION;pub use docs::OrthoConfigDocs;pub use docs::OrthoConfigSubcommandDocs;pub use docs::PathPattern;pub use docs::PrecedenceMeta;pub use docs::SectionsMetadata;pub use docs::SourceKind;pub use docs::ValueType;pub use docs::WindowsMetadata;pub use subcommand::LoadGlobalsAndSelectedSubcommandError;serde_jsonpub use subcommand::SelectedSubcommandMerge;serde_jsonpub use subcommand::SelectedSubcommandMergeError;serde_jsonpub use subcommand::load_globals_and_merge_selected_subcommand;serde_jsonpub use subcommand::load_and_merge_subcommand;serde_jsonpub use subcommand::load_and_merge_subcommand_for;serde_jsonpub use subcommand::load_and_merge_subcommand_for_with_matches;serde_jsonpub use subcommand::load_and_merge_subcommand_with_matches;serde_jsonpub use declarative::DeclarativeMerge;serde_jsonpub use declarative::MergeComposer;serde_jsonpub use declarative::MergeLayer;serde_jsonpub use declarative::MergeProvenance;serde_jsonpub use discovery::ConfigDiscovery;pub use discovery::ConfigDiscoveryBuilder;pub use discovery::DiscoveryLayersOutcome;pub use discovery::DiscoveryLoadOutcome;pub use discovery::LayerDiscoveryOutcome;pub use file::FileLayerChain;pub use file::load_config_file;pub use file::load_config_file_as_chain;pub use figment;pub use serde_json;serde_jsonpub use toml;tomlpub use uncased;pub use xdg;Redox OS or Unix
Modules§
- agent_
context - Compact machine-readable command context for agent-native CLIs.
- declarative
serde_json - Declarative merging primitives used by the derive macro.
- discovery
- Cross-platform configuration file discovery helpers.
- docs
- Documentation metadata for
OrthoConfig. - file
- Helpers for reading configuration files into Figment.
- subcommand
- Utilities for loading configuration for individual subcommands.
Macros§
Structs§
- CsvEnv
- Environment provider with CSV list support.
- Fluent
Localizer - Fluent-powered localiser that layers consumer bundles over embedded defaults.
- Fluent
Localizer Builder - Builds a
FluentLocalizer. - Formatting
Issue - Captures formatting failures encountered when resolving Fluent patterns.
- Language
Identifier LanguageIdentifieris a core struct representing a Unicode Language Identifier.- MapEnv
- Environment source backed by a fixed set of values.
- NoOp
Localizer - Default localiser that declines to translate messages.
- Post
Merge Context - Context provided to post-merge hooks.
- Process
Env - Environment source backed by the live process environment.
- With
Base - Carrier returned by
LocalizeCmd::with_base.
Enums§
- Fluent
Bundle Source - Denotes which bundle produced a localisation attempt.
- Fluent
Localizer Error - Errors surfaced when constructing a
FluentLocalizer. - Ortho
Error - Errors that can occur while loading configuration.
Traits§
- CliValue
Extractor serde_json - Re-export sanitization helpers used to strip
Nonefields and produce a Figment provider. - EnvSource
- Read-only environment access used during configuration discovery.
- Into
Figment Error - Convert shared Ortho errors into
figment::Errorfor interop in tests and integrations that expect Figment’s error type. - Localize
Cmd - Extension trait that applies a
Localizerto aclap::Commandtree. - Localized
Parse - Blanket extension trait for parsing any
clap::Parsertype with localized command metadata and errors. - Localizer
- Provides localised strings for user-facing CLI output.
- Ortho
Config - Trait implemented for structs that represent application configuration.
- Ortho
Json Merge Ext serde_json - Extension tailored to mapping
serde_json::Errorinto a merge failure. - Ortho
Merge Ext - Extension tailored to mapping
figment::Errorinto a merge failure. - Ortho
Result Ext - Generic extension for mapping any
Result<T, E>withE: Into<OrthoError>into anOrthoResult<T>. - Post
Merge Hook - Hook invoked after declarative layer merging completes.
- Result
Into Figment - Extension to convert
Result<T, Arc<OrthoError>>intoResult<T, figment::Error>.
Functions§
- clap_
error_ formatter - Builds a formatter suitable for
clap::Command::try_get_matcheserror handling. - is_
display_ request - Returns
truewhen aclap::Errorcorresponds to--helpor--version. - localize_
clap_ error - Rewrites a
claperror message using the provided localizer. - localize_
clap_ error_ with_ command - Rewrites a
claperror message, enriching localization arguments with details from the providedClapCommandwhere possible. - message_
id_ for - Builds the Fluent identifier for a command path and suffix.
- normalize_
prefix - Normalize a prefix by trimming trailing underscores and converting to lowercase ASCII.
- parse_
localized_ command - Parses arguments with a pre-built localized command and localizes parse errors through the supplied localizer.
- process_
env_ source - Return the default process-backed environment source.
- sanitize_
value serde_json - Re-export sanitization helpers used to strip
Nonefields and produce a Figment provider. - sanitized_
provider serde_json - Re-export sanitization helpers used to strip
Nonefields and produce a Figment provider. - value_
without_ nones serde_json - Re-export sanitization helpers used to strip
Nonefields and produce a Figment provider.
Type Aliases§
- Localization
Args - Arguments forwarded to localisation lookups.
- Ortho
Result - Canonical result type for public APIs in this crate.
- Shared
EnvSource - Shorthand for a shared environment source.
Derive Macros§
- Ortho
Config - Derive macro for the
OrthoConfigtrait. - Ortho
Config Subcommand Docs - Derive macro for the
ortho_config::docs::OrthoConfigSubcommandDocstrait.