Skip to content

Rust API Reference

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

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.

Module Description
commands::server Server lifecycle: start, stop, status
commands::backup Backup creation and restoration
commands::file File manager operations
commands::java Java version detection and management
commands::ngrok Ngrok tunnel setup
commands::plugin Plugin/mod browsing (Modrinth, Hangar, SpigotMC)
commands::proxy Velocity proxy setup
commands::config Application configuration persistence
commands::update App self-update via Tauri Updater

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