pub struct TargetInfo {
pub sysroot: PathBuf,
pub sysroot_host_libdir: PathBuf,
pub sysroot_target_libdir: PathBuf,
pub rustflags: Vec<String>,
pub rustdocflags: Vec<String>,
pub supports_split_debuginfo: bool,
/* private fields */
}
Expand description
Information about the platform target gleaned from querying rustc.
RustcTargetData
keeps two of these, one for the host and one for the
target. If no target is specified, it uses a clone from the host.
Fields
sysroot: PathBuf
Path to the sysroot.
sysroot_host_libdir: PathBuf
Path to the “lib” or “bin” directory that rustc uses for its dynamic libraries.
sysroot_target_libdir: PathBuf
Path to the “lib” directory in the sysroot which rustc uses for linking target libraries.
rustflags: Vec<String>
Extra flags to pass to rustc
, see env_args
.
rustdocflags: Vec<String>
Extra flags to pass to rustdoc
, see env_args
.
supports_split_debuginfo: bool
Whether or not rustc supports the -Csplit-debuginfo
flag.
Implementations
sourceimpl TargetInfo
impl TargetInfo
pub fn new(
config: &Config,
requested_kinds: &[CompileKind],
rustc: &Rustc,
kind: CompileKind
) -> CargoResult<TargetInfo>
sourcepub fn rustc_outputs(
&self,
mode: CompileMode,
target_kind: &TargetKind,
target_triple: &str
) -> CargoResult<(Vec<FileType>, Vec<CrateType>)>
pub fn rustc_outputs(
&self,
mode: CompileMode,
target_kind: &TargetKind,
target_triple: &str
) -> CargoResult<(Vec<FileType>, Vec<CrateType>)>
Returns all the file types generated by rustc for the given mode/target_kind.
The first value is a Vec of file types generated, the second value is a list of CrateTypes that are not supported by the given target.
Trait Implementations
sourceimpl Clone for TargetInfo
impl Clone for TargetInfo
sourcefn clone(&self) -> TargetInfo
fn clone(&self) -> TargetInfo
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for TargetInfo
impl Send for TargetInfo
impl !Sync for TargetInfo
impl Unpin for TargetInfo
impl UnwindSafe for TargetInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more