[Rust]How to make string handing to frontend on tauri app



This content originally appeared on DEV Community and was authored by ke na

#[tauri::command]
pub fn simple_command()->String{
    "String".to_string()
}

If you want to return a string in a Tauri command,add to_string() to the end of the string just like this.
This allows you to pass any string to the frontend like React.


This content originally appeared on DEV Community and was authored by ke na