withName static method
Implementation
static Future<RustToolchain> withName(String name) async {
final rustup = Rustup.systemRustup();
if (rustup == null) {
throw RunNativeDoctorException(message: 'Rustup not found.');
}
final toolchain = await rustup.getToolchain(name);
if (toolchain == null) {
throw RunNativeDoctorException(
message: 'Rust toolchain $name not found.');
}
return RustToolchain._(name: toolchain.name, toolchain: toolchain);
}