pub struct ConfigDocument {Show 16 fields
pub policy: Policy,
pub preflight: PreflightDef,
pub catalog: String,
pub catalog_digest: String,
pub versions: BTreeMap<String, String>,
pub groups: BTreeMap<String, Vec<String>>,
pub cargo_tools: BTreeMap<String, CargoToolInput>,
pub cargo_toolsets: BTreeMap<String, BTreeMap<String, CargoToolInput>>,
pub package_tools: BTreeMap<String, PackageToolDef>,
pub rustup_tools: BTreeMap<String, RustupToolInput>,
pub sources: BTreeMap<String, SourceDef>,
pub profiles: BTreeMap<String, ProfileDef>,
pub components: Vec<ComponentDef>,
pub environment: EnvironmentDef,
pub apt_mirror: Option<AptMirrorDef>,
pub include: Vec<PathBuf>,
}Expand description
Canonical configuration document consumed by the planner.
Fields§
§policy: PolicyGlobal security, network, and resource policy.
preflight: PreflightDefInstallation prerequisites executed before package mirrors and component detection.
catalog: StringBuilt-in catalog identifier that supplies the base configuration.
catalog_digest: StringDigest of the expanded catalog used to bind plans to their configuration source.
versions: BTreeMap<String, String>Named version values referenced by compact tool declarations.
groups: BTreeMap<String, Vec<String>>Named component lists expanded by profiles and dependency references.
cargo_tools: BTreeMap<String, CargoToolInput>Short, typed declarations expanded into canonical components at load time.
cargo_toolsets: BTreeMap<String, BTreeMap<String, CargoToolInput>>Named Cargo tool collections expanded into components and a same-named group.
package_tools: BTreeMap<String, PackageToolDef>Compact system-package declarations expanded into platform-specific components.
rustup_tools: BTreeMap<String, RustupToolInput>Compact rustup declarations expanded into canonical components.
sources: BTreeMap<String, SourceDef>Named upstream source definitions.
profiles: BTreeMap<String, ProfileDef>Named installation profiles.
components: Vec<ComponentDef>Canonical component definitions available to the planner.
environment: EnvironmentDefEnvironment paths and mutations applied after installation.
apt_mirror: Option<AptMirrorDef>Optional APT mirror configuration.
include: Vec<PathBuf>Relative local configuration fragments merged after the primary file.
Implementations§
Source§impl ConfigDocument
impl ConfigDocument
Sourcepub fn parse(input: &str) -> Result<Self, ForgeError>
pub fn parse(input: &str) -> Result<Self, ForgeError>
Parse and validate a user configuration that selects the supported built-in catalog.
§Errors
Returns ForgeError for invalid TOML, unknown fields, an absent catalog selection, or
any semantic validation failure.
Sourcepub fn validate(&self) -> Result<(), ForgeError>
pub fn validate(&self) -> Result<(), ForgeError>
Validate identifiers, references, policy limits, platform selectors, and backend contracts.
§Errors
Returns ForgeError::Config for the first rejected configuration
invariant.
Sourcepub fn merge_overlay_text(
&mut self,
input: &str,
origin: &str,
origins: &mut OriginMap,
) -> Result<(), ForgeError>
pub fn merge_overlay_text( &mut self, input: &str, origin: &str, origins: &mut OriginMap, ) -> Result<(), ForgeError>
Merge one overlay while recording the source of every changed canonical field.
§Errors
Returns ForgeError when the overlay cannot be parsed, attempts an unsupported merge, or
leaves the document semantically invalid.
Sourcepub fn component(&self, id: &str) -> Option<&ComponentDef>
pub fn component(&self, id: &str) -> Option<&ComponentDef>
Find a canonical component by its stable identifier.
Trait Implementations§
Source§impl Clone for ConfigDocument
impl Clone for ConfigDocument
Source§fn clone(&self) -> ConfigDocument
fn clone(&self) -> ConfigDocument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConfigDocument
impl Debug for ConfigDocument
Source§impl Default for ConfigDocument
impl Default for ConfigDocument
Source§fn default() -> ConfigDocument
fn default() -> ConfigDocument
Source§impl<'de> Deserialize<'de> for ConfigDocumentwhere
ConfigDocument: Default,
impl<'de> Deserialize<'de> for ConfigDocumentwhere
ConfigDocument: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ConfigDocument
Source§impl JsonSchema for ConfigDocument
impl JsonSchema for ConfigDocument
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for ConfigDocument
impl PartialEq for ConfigDocument
Source§impl Serialize for ConfigDocument
impl Serialize for ConfigDocument
impl StructuralPartialEq for ConfigDocument
Auto Trait Implementations§
impl Freeze for ConfigDocument
impl RefUnwindSafe for ConfigDocument
impl Send for ConfigDocument
impl Sync for ConfigDocument
impl Unpin for ConfigDocument
impl UnsafeUnpin for ConfigDocument
impl UnwindSafe for ConfigDocument
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.