Rust API Reference
The Rust backend API documentation is generated from inline doc-comments in src-tauri/src/ using cargo doc.
Generate Locally
cd src-tauricargo doc --no-deps --openThis opens the generated documentation in your browser at target/doc/mc_vector/index.html.
Key Modules
| 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 |
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_pathbefore use. - State is shared via Tauri’s
Stateextractor withArc<Mutex<...>>internals.
Data Flow
React component → src/lib/<module>-commands.ts (TypeScript wrapper) → invoke('<command_name>') (Tauri IPC) → src-tauri/src/commands/ (Rust handler)