pub struct Workspace { /* private fields */ }
Expand description
Directory on the filesystem containing rustwide’s state and caches.
Use WorkspaceBuilder
to create a new instance of it.
Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn build_dir(&self, name: &str) -> BuildDirectory
pub fn build_dir(&self, name: &str) -> BuildDirectory
Open a named build directory inside the workspace.
Sourcepub fn purge_all_build_dirs(&self) -> Result<()>
pub fn purge_all_build_dirs(&self) -> Result<()>
Remove all the contents of all the build directories, freeing disk space.
Sourcepub fn purge_all_caches(&self) -> Result<()>
pub fn purge_all_caches(&self) -> Result<()>
Remove all the contents of the caches in the workspace, freeing disk space.
Sourcepub fn installed_toolchains(&self) -> Result<Vec<Toolchain>>
pub fn installed_toolchains(&self) -> Result<Vec<Toolchain>>
Return a list of all the toolchains present in the workspace.
§Example
This code snippet removes all the installed toolchains except the main one:
let main_toolchain = Toolchain::dist("stable");
for installed in &workspace.installed_toolchains()? {
if *installed != main_toolchain {
installed.uninstall(&workspace)?;
}
}
Auto Trait Implementations§
impl Freeze for Workspace
impl RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnwindSafe for Workspace
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
Mutably borrows from an owned value. Read more