Skip to content
Discussion options

You must be logged in to vote
  1. Not sure what the function signature for setup function should be, the current version I use doesn't give me error.

minus the async part you basically got it right already. It's fn setup<'a>(app: &'a mut tauri::App) -> Result<(), Box<dyn std::error::Error>> -> https://docs.rs/tauri/latest/tauri/struct.Builder.html#method.setup

  1. Problem: there is error when I make setup() async

The setup function itself just can't be async, simple as that. But as you figured out yourself, you can use tauri::async_runtime to spawn async tasks, or block on them (block_on to execute async functions as if they'd be sync).

Now the almost-solution you posted was almost there. The reason why your command w…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@HuakunShen
Comment options

@SurajRaika
Comment options

@Skarian
Comment options

Answer selected by HuakunShen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants