Skip to content

Rust API Reference

The Rust backend API documentation is generated from inline doc-comments in src-tauri/src/ using cargo doc.

Generate Locally

Terminal window
cd src-tauri
cargo doc --no-deps --open

This opens the generated documentation in your browser at target/doc/mc_vector/index.html.

Key Modules

ModuleDescription
commands::serverServer lifecycle: start, stop, status
commands::backupBackup creation and restoration
commands::fileFile manager operations
commands::javaJava version detection and management
commands::ngrokNgrok tunnel setup
commands::pluginPlugin/mod browsing (Modrinth, Hangar, SpigotMC)
commands::proxyVelocity proxy setup
commands::configApplication configuration persistence
commands::updateApp self-update via Tauri Updater

Architecture

All Tauri commands follow the pattern:

#[tauri::command]
pub async fn command_name(arg: Type, state: State<'_, AppState>) -> Result<T, String> {
// Implementation
}
  • Return type is always Result<T, String> — the string becomes the JS-side error message.
  • File paths are validated through resolve_managed_path before use.
  • State is shared via Tauri’s State extractor with Arc<Mutex<...>> internals.

Data Flow

React component
→ src/lib/<module>-commands.ts (TypeScript wrapper)
→ invoke('<command_name>') (Tauri IPC)
→ src-tauri/src/commands/ (Rust handler)