[−][src]Struct cargo_rustc_cfg::Cfg
A container for the parsed output from the cargo rustc --lib -- --print cfg
command.
Implementations
impl Cfg
[src]
pub fn host() -> Result<Self, Error>
[src]
Obtains the host configuration.
This is a helper method for using the CargoRustcPrintCfg
, such that:
let cfg = CargoRustcPrintCfg::default().execute()?;
becomes:
let cfg = Cfg::host()?;
pub fn rustc_target<S>(t: S) -> Result<Self, Error> where
S: AsRef<OsStr>,
[src]
S: AsRef<OsStr>,
Obtains a configuration for a Rust compiler (rustc) target.
This is a helper method for using the CargoRustcPrintCfg
, such that:
let cfg = CargoRustcPrintCfg::default().rustc_target("x86_64-pc-windows-msvc").execute()?;
becomes:
let cfg = Cfg::rustc_target("x86_64-pc-windows-msvc")?;
pub fn extras(&self) -> Vec<&str>
[src]
Any and all additional lines from the output of the cargo rustc --print cfg
command that are not recognized as target key-value pairs.
These are any lines that were not recognized as target key-value lines,
i.e. key="value"
. Unlike the target key-value lines, any double
quotes, "
, are not removed.
Examples
let cfg = Cfg::rustc_target("x86_64-pc-windows-msvc")?; assert!(cfg.extras().contains(&"debug_assertions")); assert!(cfg.extras().contains(&"windows"));
pub fn target(&self) -> &Target
[src]
All output that is prepended by the target_
string.
These are all the recognized target key-value lines, i.e.
target_<key>="<value>"
. The double quotes, "
are removed for the
values.
pub fn into_target(self) -> Target
[src]
Consumes this configuration and converts it into the target configuration.
The target configuration is all recognized key-value lines prepended
with the target_
string.
Trait Implementations
impl Clone for Cfg
[src]
impl Debug for Cfg
[src]
impl PartialEq<Cfg> for Cfg
[src]
impl StructuralPartialEq for Cfg
[src]
Auto Trait Implementations
impl RefUnwindSafe for Cfg
impl Send for Cfg
impl Sync for Cfg
impl Unpin for Cfg
impl UnwindSafe for Cfg
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,