pub struct Cfg {
    pub target_os: String,
    pub target_family: Option<String>,
    pub target_arch: String,
    pub target_endian: String,
    pub target_pointer_width: String,
    pub target_env: String,
    pub target_vendor: Option<String>,
    pub target_has_atomic: Vec<String>,
    pub target_feature: Vec<String>,
    /* private fields */
}
Expand description

The result of parsing the output of rustc --print cfg

Fields

target_os: String

Equivalent to cfg(target_os = "..")

target_family: Option<String>

Equivalent to cfg(unix) or cfg(windows)

target_arch: String

Equivalent to cfg(target_arch = "..")

target_endian: String

Equivalent to cfg(target_endian = "..")

target_pointer_width: String

Equivalent to cfg(target_pointer_width = "..")

target_env: String

Equivalent to cfg(target_env = "..")

target_vendor: Option<String>

Equivalent to cfg(target_vendor = "..").

target_has_atomic: Vec<String>

Equivalent to cfg(target_has_atomic = "..")

target_feature: Vec<String>

Equivalent to cfg(target_feature = "..")

Implementations

Runs rustc --target <target> --print cfg and returns the parsed output.

The target should be a “triple” from the list of supported rustc targets. A list of supported rustc targets can be obtained using the rustc --print target-list command. This should not be confused with Cargo targets, i.e. binaries, [[bin]] and a library [lib] define in a package’s manifest (Cargo.toml).

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.