Yeah, it works pretty well for me. Rust definitely took some getting used to (I was new to it when I started).
There's a lot of functionality you can access from JS without needing to get into Rust, but on the Rust side Tauri has this notion of "commands" for calling Rust from the UI.
You can write a Rust function and annotate it with #[tauri::command], and register it, and then you can call it from the JS side with invoke('your_command_name', args). Those commands can be async too, so you can do blocking work on the Rust side and the UI won't freeze.
You can inject State variables into those commands, which get injected at call time and are effectively global to the Rust side. I would say the State stuff is a bit unergonomic in that you run up against needing to share them between threads, so everything inside them needs to be Arc<Mutex<>> and writing those wrappers was boilerplatey.
I wish the JS <-> Rust calling overhead were lower. It serializes everything to JSON and back, so I try to avoid too many calls, and try to avoid sending lots of data between them.
Yeah, it works pretty well for me. Rust definitely took some getting used to (I was new to it when I started).
There's a lot of functionality you can access from JS without needing to get into Rust, but on the Rust side Tauri has this notion of "commands" for calling Rust from the UI.
You can write a Rust function and annotate it with #[tauri::command], and register it, and then you can call it from the JS side with invoke('your_command_name', args). Those commands can be async too, so you can do blocking work on the Rust side and the UI won't freeze.
You can inject State variables into those commands, which get injected at call time and are effectively global to the Rust side. I would say the State stuff is a bit unergonomic in that you run up against needing to share them between threads, so everything inside them needs to be Arc<Mutex<>> and writing those wrappers was boilerplatey.
I wish the JS <-> Rust calling overhead were lower. It serializes everything to JSON and back, so I try to avoid too many calls, and try to avoid sending lots of data between them.