🦀 vx-tool-rust
Rust Programming Language Tool Plugin for vx Universal Tool Manager
Blazing fast Rust development with beautiful installation experience and zero configuration
Overview
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.
Features
- Rust Toolchain: Complete Rust compiler and tools
- Cargo Integration: Built-in Cargo package manager and build tool
- Auto-Installation: Automatic download and installation of Rust versions
- Cross-Platform: Windows, macOS, and Linux support
- Version Management: Install and switch between multiple Rust versions
- Target Support: Cross-compilation for multiple targets
- Component Management: Install additional Rust components
Supported Commands
Rust Compiler
# Compile Rust code
# Check code without building
Cargo Package Manager
# Project management
# Testing
# Package management
Development Tools
# Code formatting
# Linting
# Documentation
# Publishing
Installation
Through vx CLI
# Install latest stable
# Install specific version
# Install latest version
Version Constraints
# Semantic version ranges
Configuration
Project Configuration (.vx.toml)
[]
= "1.75.0" # Specific version
# rust = "stable" # Latest stable
# rust = "beta" # Beta channel
# rust = "nightly" # Nightly channel
[]
= true
= "x86_64-unknown-linux-gnu"
Global Configuration
[]
= "stable"
= true
= 600
[]
= "stable"
= "default"
= ["rustfmt", "clippy"]
= ["wasm32-unknown-unknown"]
Toolchain Management
Channels
- stable: Latest stable release (recommended)
- beta: Beta releases (6-week cycle)
- nightly: Nightly builds (daily)
Components
# Install additional components
# List components
Targets
# Add compilation targets
# List targets
Platform Support
Windows
- x64: Full support
- x86: Legacy support
- ARM64: Windows 11 ARM support
macOS
- x64: Intel Mac support
- ARM64: Apple Silicon (M1/M2) support
Linux
- x64: All major distributions
- ARM64: ARM-based systems
- ARMv7: Raspberry Pi support
Cross-Compilation
Common Targets
# WebAssembly
# Windows from Linux
# macOS from Linux
Build Configuration
# .cargo/config.toml
[]
= "x86_64-unknown-linux-gnu"
[]
= "x86_64-w64-mingw32-gcc"
[]
= "wasm-pack"
Integration
With vx-core
use ;
use RustTool;
let rust_tool = new;
let manager = new;
// Install Rust
manager.install_tool.await?;
// Execute Rust commands
manager.execute_tool.await?;
Plugin Registration
use ;
use RustPlugin;
let plugin = new;
let mut manager = new;
manager.register_plugin?;
Development
Building
Testing
Integration Testing
# Test with actual Rust installation
Implementation Details
Tool Structure
- RustTool: Main Rust compiler (rustc)
- CargoTool: Cargo package manager and build tool
- RustupTool: Rustup toolchain manager
Version Resolution
- Project Config: Check
.vx.toml
for version specification - Global Config: Fall back to global default
- Stable Channel: Use latest stable if no version specified
- Auto-Install: Download and install if not available
Installation Process
- Rustup Download: Download rustup installer
- Toolchain Install: Install specified Rust version
- Component Setup: Install default components
- Verification: Verify installation integrity
- Environment Setup: Configure CARGO_HOME and RUSTUP_HOME
Project Templates
Binary Application
# Create new binary project
# Add dependencies
# Build and run
Library Crate
# Create new library
# Add dependencies
# Test
WebAssembly Project
# Install wasm target
# Create project
# Configure for wasm
# Build for wasm
Error Handling
Common Errors
- Network Issues: Download failures, registry timeouts
- Permission Errors: Installation directory access
- Compilation Errors: Code compilation failures
- Dependency Conflicts: Cargo dependency resolution
Recovery
# Reinstall Rust
# Clear Cargo cache
# Update dependencies
# Use system Rust as fallback
Performance
- Fast Compilation: Rust's efficient compilation
- Incremental Builds: Cargo's incremental compilation
- Parallel Downloads: Concurrent dependency downloads
- Build Caching: Shared build cache across projects
Security
- Checksum Verification: SHA256 verification of downloads
- HTTPS Only: Secure downloads from official sources
- Crate Verification: Cargo registry verification
- Sandboxed Builds: Isolated build environments
Troubleshooting
Installation Issues
# Check Rust installation
# Verify toolchain
# Check environment
# Force reinstall
Build Issues
# Check project
# Clean build
# Update dependencies
# Debug build
Component Issues
# List components
# Reinstall component
# Update toolchain
Best Practices
Project Structure
myproject/
├── Cargo.toml
├── Cargo.lock
├── src/
│ ├── main.rs
│ └── lib.rs
├── tests/
│ └── integration_test.rs
├── benches/
│ └── benchmark.rs
└── examples/
└── example.rs
Cargo.toml Configuration
[]
= "myproject"
= "0.1.0"
= "2021"
= "1.70"
[]
= { = "1.0", = ["derive"] }
= { = "1.0", = ["full"] }
[]
= "0.5"
[[]]
= "my_benchmark"
= false
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please see the contributing guidelines for more information.
Related Crates
vx-core
- Core functionalityvx-cli
- Command-line interfacevx-tool-node
- Node.js toolvx-tool-go
- Go tool