[][src]Struct rustwide::toolchain::Toolchain

pub struct Toolchain { /* fields omitted */ }

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

impl Toolchain[src]

pub fn dist(name: &str) -> Self[src]

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).

pub fn ci(sha: &str, alt: bool) -> Self[src]

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!

pub fn as_dist(&self) -> Option<&DistToolchain>[src]

If this toolchain is a dist toolchain, return its metadata.

pub fn as_ci(&self) -> Option<&CiToolchain>[src]

If this toolchain is a CI toolchain, return its metadata.

pub fn install(&self, workspace: &Workspace) -> Result<(), Error>[src]

Download and install the toolchain.

pub fn add_component(
    &self,
    workspace: &Workspace,
    name: &str
) -> Result<(), Error>
[src]

Download and install a component for the toolchain.

pub fn add_target(&self, workspace: &Workspace, name: &str) -> Result<(), Error>[src]

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.

pub fn remove_target(
    &self,
    workspace: &Workspace,
    name: &str
) -> Result<(), Error>
[src]

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.

pub fn installed_targets(
    &self,
    workspace: &Workspace
) -> Result<Vec<String>, Error>
[src]

Return a list of installed targets for this toolchain.

If the toolchain is not installed an empty list is returned.

pub fn uninstall(&self, workspace: &Workspace) -> Result<(), Error>[src]

Remove the toolchain from the rustwide workspace, freeing up disk space.

pub fn cargo<'a>(&'a self) -> impl Runnable + 'a[src]

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()?;

pub fn rustc<'a>(&'a self) -> impl Runnable + 'a[src]

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()?;

Trait Implementations

impl Clone for Toolchain[src]

impl Debug for Toolchain[src]

impl<'de> Deserialize<'de> for Toolchain[src]

impl Display for Toolchain[src]

impl Eq for Toolchain[src]

impl Hash for Toolchain[src]

impl PartialEq<Toolchain> for Toolchain[src]

impl Serialize for Toolchain[src]

impl StructuralEq for Toolchain[src]

impl StructuralPartialEq for Toolchain[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,