pub struct Cargo {
command: BootstrapCommand,
compiler: Compiler,
target: TargetSelection,
rustflags: Rustflags,
rustdocflags: Rustflags,
hostflags: HostFlags,
allow_features: String,
}
Fields§
§command: BootstrapCommand
§compiler: Compiler
§target: TargetSelection
§rustflags: Rustflags
§rustdocflags: Rustflags
§hostflags: HostFlags
§allow_features: String
Implementations§
Source§impl Cargo
impl Cargo
Sourcepub fn new(
builder: &Builder<'_>,
compiler: Compiler,
mode: Mode,
source_type: SourceType,
target: TargetSelection,
cmd_kind: Kind,
) -> Cargo
pub fn new( builder: &Builder<'_>, compiler: Compiler, mode: Mode, source_type: SourceType, target: TargetSelection, cmd_kind: Kind, ) -> Cargo
Calls Builder::cargo
and Cargo::configure_linker
to prepare an invocation of cargo
to be run.
pub fn into_cmd(self) -> BootstrapCommand
Sourcepub fn new_for_mir_opt_tests(
builder: &Builder<'_>,
compiler: Compiler,
mode: Mode,
source_type: SourceType,
target: TargetSelection,
cmd_kind: Kind,
) -> Cargo
pub fn new_for_mir_opt_tests( builder: &Builder<'_>, compiler: Compiler, mode: Mode, source_type: SourceType, target: TargetSelection, cmd_kind: Kind, ) -> Cargo
Same as Cargo::new
except this one doesn’t configure the linker with
Cargo::configure_linker
.
pub fn rustdocflag(&mut self, arg: &str) -> &mut Cargo
pub fn rustflag(&mut self, arg: &str) -> &mut Cargo
pub fn arg(&mut self, arg: impl AsRef<OsStr>) -> &mut Cargo
pub fn args<I, S>(&mut self, args: I) -> &mut Cargo
Sourcepub fn env(
&mut self,
key: impl AsRef<OsStr>,
value: impl AsRef<OsStr>,
) -> &mut Cargo
pub fn env( &mut self, key: impl AsRef<OsStr>, value: impl AsRef<OsStr>, ) -> &mut Cargo
Add an env var to the cargo command instance. Note that RUSTFLAGS
/RUSTDOCFLAGS
must go
through Cargo::rustdocflags
and Cargo::rustflags
because inconsistent RUSTFLAGS
and RUSTDOCFLAGS
usages will trigger spurious rebuilds.
pub fn add_rustc_lib_path(&mut self, builder: &Builder<'_>)
pub fn current_dir(&mut self, dir: &Path) -> &mut Cargo
Sourcepub fn allow_features(&mut self, features: &str) -> &mut Cargo
pub fn allow_features(&mut self, features: &str) -> &mut Cargo
Adds nightly-only features that this invocation is allowed to use.
By default, all nightly features are allowed. Once this is called, it will be restricted to the given set.
fn configure_linker(&mut self, builder: &Builder<'_>) -> &mut Cargo
Trait Implementations§
Source§impl From<Cargo> for BootstrapCommand
impl From<Cargo> for BootstrapCommand
Source§fn from(cargo: Cargo) -> BootstrapCommand
fn from(cargo: Cargo) -> BootstrapCommand
Auto Trait Implementations§
impl Freeze for Cargo
impl !RefUnwindSafe for Cargo
impl Send for Cargo
impl Sync for Cargo
impl Unpin for Cargo
impl !UnwindSafe for Cargo
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
§impl<T> Pointable for T
impl<T> Pointable for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 504 bytes