Organizing Rust code within Tauri

Hi, as a newbie, I need to test my code continuously to see what's happening.

With pure Rust I use Cargo (or Bacon) and everything is fine, but Tauri is very slow compiling during development, so I had an idea. Please tell me if it will make my life simpler or more complicated :face_with_spiral_eyes:.

I could split the pure rust code into more manageable pieces to work on them separately, using Cargo to compile constantly. I could create some kind of bridge functions to shortcut Tauri's ins and outs until the code is ok.

  • I can create modules, but if an external crate is needed, I can't put it in the main TOML, so I think I should use libraries.

  • I can create libraries, with their own TOML, but in some cases there will be duplicate crates (like Serde, for example).

And, obviously, I also want to be able to run the full Tauri.

Any guidance would be welcome.

That’s normal. In a given build, Cargo always compiles compatible library versions only once.

Thank you!

As your idea put my mind at ease, I've been testing different possibilities for a few days.

Now, I'm splitting some complex code in parts as if they were libraries, in a parent directory and including them in the main TOML.

In the end, Tauri must compile those libraries again and again, but at least I can write rust through trial and error without waiting for Tauri to start.