Skip to main content

Module command

Module command 

Source
Expand description

Generic result/error helpers for Tauri command handlers.

Tauri commands surface errors to the frontend as plain Strings. Every handler in a src-tauri package ends up writing the same .map_err(|err| err.to_string()) boilerplate; this module centralizes it.

Traits§

TauriResultExt
Extension trait converting any Result<T, E: Display> into a CommandResult<T> without a manual .map_err(|err| err.to_string()) at every call site.

Type Aliases§

CommandResult
The result shape every #[tauri::command] handler in a Soma-derived desktop app should return: Ok(T) on success, or a display-formatted error string the frontend can show directly.