pub struct RustupManager;Expand description
Rustup manager for toolchain operations
Implementations§
Source§impl RustupManager
impl RustupManager
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if rustup is available on the system
Sourcepub async fn get_current_version(&self) -> Result<RustVersion>
pub async fn get_current_version(&self) -> Result<RustVersion>
Get the current Rust version with toolchain info
§Errors
Returns an error if rustc is not found or its version output cannot be parsed.
Sourcepub fn list_toolchains(&self) -> Result<Vec<ToolchainInfo>>
pub fn list_toolchains(&self) -> Result<Vec<ToolchainInfo>>
List all installed toolchains
§Errors
Returns an error if rustup is not available or the toolchain list cannot be retrieved.
Sourcepub async fn install_toolchain(&self, channel: &ToolchainChannel) -> Result<()>
pub async fn install_toolchain(&self, channel: &ToolchainChannel) -> Result<()>
Install a specific toolchain
§Errors
Returns an error if rustup is not available or the installation fails.
Sourcepub async fn uninstall_toolchain(
&self,
channel: &ToolchainChannel,
) -> Result<()>
pub async fn uninstall_toolchain( &self, channel: &ToolchainChannel, ) -> Result<()>
Uninstall a specific toolchain
§Errors
Returns an error if rustup is not available or the uninstallation fails.
Sourcepub async fn switch_toolchain(&self, channel: &ToolchainChannel) -> Result<()>
pub async fn switch_toolchain(&self, channel: &ToolchainChannel) -> Result<()>
Switch to a different toolchain (set as default)
§Errors
Returns an error if rustup is not available or the switch fails.
Sourcepub async fn update_toolchains(&self) -> Result<UpdateResult>
pub async fn update_toolchains(&self) -> Result<UpdateResult>
Update all installed toolchains
§Errors
Returns an error if rustup is not available or the update fails.
Sourcepub async fn install_component(
&self,
component: &str,
toolchain: Option<&str>,
) -> Result<()>
pub async fn install_component( &self, component: &str, toolchain: Option<&str>, ) -> Result<()>
Install a toolchain component (e.g., clippy, rustfmt)
§Errors
Returns an error if rustup is not available or the component installation fails.
Sourcepub async fn get_version_requirements(&self) -> Result<VersionRequirements>
pub async fn get_version_requirements(&self) -> Result<VersionRequirements>
Get version requirements from locked configuration
§Errors
Returns an error if loading the lock configuration fails.
Sourcepub async fn check_version_requirements(&self) -> Result<VersionCheckResult>
pub async fn check_version_requirements(&self) -> Result<VersionCheckResult>
Check if current Rust version meets locked requirements
§Errors
Returns an error if the current version cannot be determined or the lock configuration cannot be loaded.
Sourcepub async fn self_update(&self) -> Result<()>
pub async fn self_update(&self) -> Result<()>
Run rustup self-update
§Errors
Returns an error if rustup is not available or the self-update fails.
Sourcepub fn show_active_toolchain(&self) -> Result<String>
pub fn show_active_toolchain(&self) -> Result<String>
Show active toolchain information
§Errors
Returns an error if rustup is not available or the active toolchain cannot be determined.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RustupManager
impl RefUnwindSafe for RustupManager
impl Send for RustupManager
impl Sync for RustupManager
impl Unpin for RustupManager
impl UnsafeUnpin for RustupManager
impl UnwindSafe for RustupManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more