DEV Community

ke na
ke na

Posted on

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

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

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.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more