Struct rustwide::toolchain::Toolchain [−][src]
pub struct Toolchain { /* fields omitted */ }
Expand description
Representation of a Rust compiler toolchain.
The Toolchain
struct represents a compiler toolchain, either downloaded from rustup or from
the rust-lang/rust repo’s CI artifacts storage, and it provides the methods to install
and use it.
Implementations
Returns whether or not this toolchain is needed by rustwide itself.
This toolchain is used for doing things like installing tools.
let tc = Toolchain::dist("stable-x86_64-unknown-linux-gnu"); assert!(tc.is_needed_by_rustwide()); let tc = Toolchain::dist("nightly-x86_64-unknown-linux-gnu"); assert!(!tc.is_needed_by_rustwide());
Create a new dist toolchain.
Dist toolchains are all the toolchains available through rustup and distributed from static.rust-lang.org. You need to provide the toolchain name (the same you’d use to install that toolchain with rustup).
This is supported on crate feature unstable-toolchain-ci
only.
unstable-toolchain-ci
only.Create a new CI toolchain.
CI toolchains are artifacts built for every merged PR in the rust-lang/rust repository, identified by the SHA of the merge commit. These builds are purged after a couple of months, and are available both in normal mode and “alternate” mode (experimental builds with extra debugging and testing features enabled).
There is no availability or stability guarantee for these builds!
If this toolchain is a dist toolchain, return its metadata.
This is supported on crate feature unstable-toolchain-ci
only.
unstable-toolchain-ci
only.If this toolchain is a CI toolchain, return its metadata.
Download and install the toolchain.
Download and install a component for the toolchain.
Remove a component already installed for the toolchain.
Download and install a target for the toolchain.
If the toolchain is not installed in the workspace an error will be returned. This is only supported for dist toolchains.
Remove a target already installed for the toolchain.
If the toolchain is not installed in the workspace or the target is missing an error will be returned. This is only supported for dist toolchains.
Return a list of installed targets for this toolchain.
If the toolchain is not installed an empty list is returned.
Remove the toolchain from the rustwide workspace, freeing up disk space.
Return a runnable object configured to run cargo
with this toolchain. This method is
intended to be used with rustwide::cmd::Command
.
Example
let toolchain = Toolchain::dist("beta"); Command::new(&workspace, toolchain.cargo()) .args(&["check"]) .run()?;
Return a runnable object configured to run rustc
with this toolchain. This method is
intended to be used with rustwide::cmd::Command
.
Example
let toolchain = Toolchain::dist("beta"); Command::new(&workspace, toolchain.rustc()) .args(&["hello.rs"]) .run()?;
Return a runnable object configured to run name
with this toolchain. This method is
intended to be used with rustwide::cmd::Command
.
Example
let toolchain = Toolchain::dist("beta"); Command::new(&workspace, toolchain.rustup_binary("rustdoc")) .args(&["hello.rs"]) .run()?;
Trait Implementations
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 RefUnwindSafe for Toolchain
impl UnwindSafe for Toolchain
Blanket Implementations
Mutably borrows from an owned value. Read more