| Crates.io | vx-tool-rust |
| lib.rs | vx-tool-rust |
| version | 0.4.0 |
| created_at | 2025-06-15 04:03:56.680949+00 |
| updated_at | 2025-06-19 13:56:06.968217+00 |
| description | Rust tool support for vx |
| homepage | https://github.com/loonghao/vx |
| repository | https://github.com/loonghao/vx |
| max_upload_size | |
| id | 1712891 |
| size | 84,248 |
Rust Programming Language Tool Plugin for vx Universal Tool Manager
Blazing fast Rust development with beautiful installation experience and zero configuration
vx-tool-rust provides Rust programming language support for vx, enabling automatic installation, version management, and execution of Rust toolchain commands through the vx interface.
# Compile Rust code
vx rustc main.rs
vx rustc --version
vx rustc --explain E0308
# Check code without building
vx rustc --emit=metadata main.rs
# Project management
vx cargo new myproject
vx cargo init
vx cargo build
vx cargo run
# Testing
vx cargo test
vx cargo test --release
vx cargo bench
# Package management
vx cargo add serde
vx cargo remove serde
vx cargo update
# Code formatting
vx cargo fmt
vx cargo fmt --check
# Linting
vx cargo clippy
vx cargo clippy -- -D warnings
# Documentation
vx cargo doc
vx cargo doc --open
# Publishing
vx cargo publish
vx cargo package
# Install latest stable
vx install rust
# Install specific version
vx install rust@1.75.0
vx install rust@1.74.1
# Install latest version
vx install rust@latest
# Semantic version ranges
vx install rust@^1.75.0 # Latest 1.75.x
vx install rust@~1.75.0 # Latest 1.75.0.x
vx install rust@>=1.70.0 # 1.70.0 or higher
[tools]
rust = "1.75.0" # Specific version
# rust = "stable" # Latest stable
# rust = "beta" # Beta channel
# rust = "nightly" # Nightly channel
[tools.rust]
auto_install = true
default_target = "x86_64-unknown-linux-gnu"
[tools.rust]
default_version = "stable"
auto_install = true
install_timeout = 600
[rust.settings]
default_toolchain = "stable"
profile = "default"
components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"]
# Install additional components
vx rustup component add rustfmt
vx rustup component add clippy
vx rustup component add rust-src
vx rustup component add rust-analyzer
# List components
vx rustup component list
vx rustup component list --installed
# Add compilation targets
vx rustup target add wasm32-unknown-unknown
vx rustup target add x86_64-pc-windows-gnu
vx rustup target add aarch64-apple-darwin
# List targets
vx rustup target list
vx rustup target list --installed
# WebAssembly
vx rustup target add wasm32-unknown-unknown
vx cargo build --target wasm32-unknown-unknown
# Windows from Linux
vx rustup target add x86_64-pc-windows-gnu
vx cargo build --target x86_64-pc-windows-gnu
# macOS from Linux
vx rustup target add x86_64-apple-darwin
vx cargo build --target x86_64-apple-darwin
# .cargo/config.toml
[build]
target = "x86_64-unknown-linux-gnu"
[target.x86_64-pc-windows-gnu]
linker = "x86_64-w64-mingw32-gcc"
[target.wasm32-unknown-unknown]
runner = "wasm-pack"
use vx_core::{Tool, ToolManager};
use vx_tool_rust::RustTool;
let rust_tool = RustTool::new();
let manager = ToolManager::new();
// Install Rust
manager.install_tool(&rust_tool, "1.75.0").await?;
// Execute Rust commands
manager.execute_tool(&rust_tool, &["--version"]).await?;
use vx_core::{Plugin, PluginManager};
use vx_tool_rust::RustPlugin;
let plugin = RustPlugin::new();
let mut manager = PluginManager::new();
manager.register_plugin(Box::new(plugin))?;
cd crates/vx-tool-rust
cargo build
cargo test
# Test with actual Rust installation
cargo test --features integration-tests
.vx.toml for version specification# Create new binary project
vx cargo new myapp
cd myapp
# Add dependencies
vx cargo add clap serde
# Build and run
vx cargo build
vx cargo run
# Create new library
vx cargo new --lib mylib
cd mylib
# Add dependencies
vx cargo add serde --features derive
# Test
vx cargo test
# Install wasm target
vx rustup target add wasm32-unknown-unknown
# Create project
vx cargo new --lib wasm-project
cd wasm-project
# Configure for wasm
cat >> Cargo.toml << EOF
[lib]
crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = "0.2"
EOF
# Build for wasm
vx cargo build --target wasm32-unknown-unknown
# Reinstall Rust
vx install rust@1.75.0 --force
# Clear Cargo cache
vx cargo clean
# Update dependencies
vx cargo update
# Use system Rust as fallback
vx --use-system-path cargo --version
# Check Rust installation
vx rustc --version
vx cargo --version
# Verify toolchain
vx rustup show
# Check environment
vx rustup which rustc
vx rustup which cargo
# Force reinstall
vx remove rust@1.75.0
vx install rust@1.75.0
# Check project
vx cargo check
# Clean build
vx cargo clean
vx cargo build
# Update dependencies
vx cargo update
# Debug build
vx cargo build --verbose
# List components
vx rustup component list --installed
# Reinstall component
vx rustup component remove rustfmt
vx rustup component add rustfmt
# Update toolchain
vx rustup update
myproject/
├── Cargo.toml
├── Cargo.lock
├── src/
│ ├── main.rs
│ └── lib.rs
├── tests/
│ └── integration_test.rs
├── benches/
│ └── benchmark.rs
└── examples/
└── example.rs
[package]
name = "myproject"
version = "0.1.0"
edition = "2021"
rust-version = "1.70"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1.0", features = ["full"] }
[dev-dependencies]
criterion = "0.5"
[[bench]]
name = "my_benchmark"
harness = false
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please see the contributing guidelines for more information.
vx-core - Core functionalityvx-cli - Command-line interfacevx-tool-node - Node.js toolvx-tool-go - Go tool