Skip to content

about App and AppHandle struct #8526

Answered by FabianLars
ggslayer asked this question in Q&A
Discussion options

You must be logged in to vote

You basically always want an AppHandle. It's also the only thing you can move into threads for example. You only use App if you get it from tauri directly, for example in the Builder's setup hook. But then again, once you have to move that into a different context (a thread, or a struct member) you'd want to get an AppHandle via app.handle().

The difference between App and AppHandle is really just that the AppHandle is a handle or a reference to the instance of App (concept wise similar-ish to & in rust if that helps). You can have multiple AppHandle instances but only one App == You can have multiple references to your main app but you can only have on actual app.

I want save a app inst…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ggslayer
Comment options

@FabianLars
Comment options

@dremnik
Comment options

@FabianLars
Comment options

Answer selected by ggslayer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #8525 on January 02, 2024 13:54.