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<(), Error>
pub fn purge_all_build_dirs(&self) -> Result<(), Error>
Remove all the contents of all the build directories, freeing disk space.
sourcepub fn purge_all_caches(&self) -> Result<(), Error>
pub fn purge_all_caches(&self) -> Result<(), Error>
Remove all the contents of the caches in the workspace, freeing disk space.
sourcepub fn installed_toolchains(&self) -> Result<Vec<Toolchain>, Error>
pub fn installed_toolchains(&self) -> Result<Vec<Toolchain>, Error>
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 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