#[non_exhaustive]pub struct Config {
pub alias: BTreeMap<String, StringList>,
pub build: BuildConfig,
pub doc: DocConfig,
pub env: BTreeMap<String, EnvConfigValue>,
pub future_incompat_report: FutureIncompatReportConfig,
pub cargo_new: CargoNewConfig,
pub http: HttpConfig,
pub net: NetConfig,
pub registries: BTreeMap<String, RegistriesConfigValue>,
pub registry: RegistryConfig,
pub target: BTreeMap<String, TargetConfig>,
pub term: TermConfig,
}Expand description
Cargo configuration that environment variables, config overrides, and target-specific configurations have not been resolved.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.alias: BTreeMap<String, StringList>The [alias] table.
build: BuildConfigThe [build] table.
doc: DocConfigThe [doc] table.
env: BTreeMap<String, EnvConfigValue>The [env] table.
future_incompat_report: FutureIncompatReportConfigThe [future-incompat-report] table.
cargo_new: CargoNewConfigThe [cargo-new] table.
http: HttpConfigThe [http] table.
net: NetConfigThe [net] table.
registries: BTreeMap<String, RegistriesConfigValue>The [registries] table.
registry: RegistryConfigThe [registry] table.
target: BTreeMap<String, TargetConfig>The [target] table.
term: TermConfigThe [term] table.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load() -> Result<Self, Error>
pub fn load() -> Result<Self, Error>
Read config files hierarchically from the current directory and merges them.
Sourcepub fn load_with_cwd<P: AsRef<Path>>(cwd: P) -> Result<Self, Error>
pub fn load_with_cwd<P: AsRef<Path>>(cwd: P) -> Result<Self, Error>
Read config files hierarchically from the given directory and merges them.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
Mutably borrows from an owned value. Read more