[][src]Struct rustwide::WorkspaceBuilder

pub struct WorkspaceBuilder { /* fields omitted */ }

Builder of a Workspace.

Methods

impl WorkspaceBuilder[src]

pub fn new(path: &Path, user_agent: &str) -> Self[src]

Create a new builder.

The provided path will be the home of the workspace, containing all the data generated by rustwide (including state and caches).

pub fn sandbox_image(self, image: SandboxImage) -> Self[src]

Override the image used for sandboxes.

By default rustwide will use the rustops/crates-build-env image on Linux systems, and rustops/crates-build-env-windows on Windows systems. Those images contain dependencies to build a large amount of crates.

pub fn command_timeout(self, timeout: Option<Duration>) -> Self[src]

Set the default timeout of Command, which can be overridden with the Command::timeout method. To disable the timeout set its value to None. By default the timeout is 15 minutes.

pub fn command_no_output_timeout(self, timeout: Option<Duration>) -> Self[src]

Set the default no output timeout of Command, which can be overridden with the Command::no_output_timeout method. To disable the timeout set its value to None. By default it's disabled.

pub fn fast_init(self, enable: bool) -> Self[src]

Enable or disable fast workspace initialization (disabled by default).

Fast workspace initialization will change the initialization process to prefer initialization speed to runtime performance, for example by installing the tools rustwide needs in debug mode instead of release mode. It's not recommended to enable fast workspace initialization with production workloads, but it can help in CIs or other automated testing scenarios.

pub fn fetch_registry_index_during_builds(self, enable: bool) -> Self[src]

Enable or disable fetching the registry's index during each build (enabled by default).

When this option is disabled the index will only be fetched when the workspace is initialized, and no following build do that again. It's useful to disable it when you need to build a lot of crates in a batch, but having the option disabled might cause trouble if you need to build recently published crates, as they might be missing from the cached index.

To call this method the unstable rustwide feature flag needs to be enabled, as it relies on unstable Cargo features.

pub fn running_inside_docker(self, inside: bool) -> Self[src]

Enable or disable support for running Rustwide itself inside Docker (disabled by default).

When support is enabled Rustwide will try to detect whether it's actually running inside a Docker container during initialization, and in that case it will adapt itself. This is needed because starting a sibling container from another one requires mount sources to be remapped to the real directory on the host.

Other than enabling support for it, to run Rustwide inside Docker your container needs to meet these requirements:

  • The Docker socker (/var/run/docker.sock) needs to be mounted inside the container.
  • The workspace directory must be either mounted from the host system or in a child directory of a mount from the host system. Workspaces created inside the container are not supported.

pub fn rustup_profile(self, profile: &str) -> Self[src]

Name of the rustup profile used when installing toolchains. The default is minimal.

pub fn init(self) -> Result<Workspace, Error>[src]

Initialize the workspace. This will create all the necessary local files and fetch the rest from the network. It's not unexpected for this method to take minutes to run on slower network connections.

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> Erased for T

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

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