Expand description
Port of internal/variables/resolver.go.
Structs§
- Resolver
Lookup - Adapts a
&dyn ResolvertoLookup, since both traits share the exactlookup(&self, name: &str) -> Option<String>signature. Needed at theconfig↔variablesmodule boundary:variables::expand::expand_mapandexpand_definitiontake&dyn Lookup, butconfig::caproni’s loader only has aBox<dyn Resolver>to offer them. A thin wrapper struct is used rather thanimpl Lookup for dyn Resolver, because Rust’sdyn-to-dyncoercion only applies to supertrait upcasting, not an arbitrary blanket impl relating two unrelated traits.
Traits§
- Lookup
- Resolves a variable name to its value. Matches
variables.Lookupin the Go original (used byexpand.go’sLookupfunction type). - Resolver
- Resolves variable names to string values. Immutable after construction and
safe for concurrent use, once the eventual implementation lands (the Go
original documents this contract on the
Resolverinterface).
Functions§
- new_
resolver - Resolves all predefined, tool-version, and static variables up front and
returns an immutable
Resolver. Precedence, highest first: static variables, predefined variables, tool versions, then (viaexpand) the process environment.