Tauri IPC Commands
All backend logic is exposed as Tauri commands. No HTTP server runs inside the app. Frontend calls these via invoke():
import { invoke } from '@tauri-apps/api/core';const result = await invoke<string>('run_top_gear', { simcContent });Commands
Section titled “Commands”run_top_gear
Section titled “run_top_gear”Runs a SimulationCraft simulation.
| Input | simc_content: String — the complete .simc file content |
| Output | String — the json2 output content |
| Defined in | commands/run_simc.rs |
Behavior:
- Writes
simc_contentto a temp file (uuid.simc) - Creates a temp path for JSON output (
uuid.json) - Invokes the SimC sidecar via
app.shell().sidecar("simc") - Waits for exit — checks JSON file exists (not exit code)
- Reads and returns the JSON file content
- Cleans up both temp files
fetch_item_data
Section titled “fetch_item_data”Fetches item data from Wowhead.
| Input | item_id: u32 |
| Output | String — Wowhead XML response |
| Defined in | commands/item_data.rs |
Used by the frontend item cache to resolve item names and quality colors.
search_items
Section titled “search_items”Searches the bundled item database.
| Input | query: String |
| Output | Vec<ItemSearchResult> |
| Defined in | commands/item_data.rs |
Searches items.db using SQLite FTS5 full-text search. Returns up to 10 results with item name, slot, and quality.
get_config
Section titled “get_config”Reads the user’s app configuration.
| Input | — |
| Output | AppConfig |
| Defined in | commands/config.rs |
Returns the persisted configuration including SimC binary path override and thread count.
set_config
Section titled “set_config”Updates the user’s app configuration.
| Input | AppConfig |
| Output | — |
| Defined in | commands/config.rs |
Persists configuration changes via Tauri’s store plugin.
validate_simc_binary
Section titled “validate_simc_binary”Checks that the SimC sidecar is accessible and working.
| Input | — |
| Output | BinaryStatus |
| Defined in | commands/config.rs |
Run on app startup. On macOS, also strips the quarantine xattr from the sidecar binary.
Adding New Commands
Section titled “Adding New Commands”- Create
src-tauri/src/commands/my_feature.rs - Define:
#[tauri::command] pub async fn my_feature(...) -> Result<T, String> - Register in
main.rs:tauri::generate_handler![..., my_feature] - Call from TypeScript:
invoke<T>('my_feature', { args })
All commands must be async to avoid blocking the Tauri main thread.