How to properly call an async function inside state management with tauri command? #6531
-
when i try call an async function inside state management using tauri command like this
It will failed to compile and get this error:
What's the proper way to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
FabianLars
Mar 22, 2023
Replies: 1 comment 1 reply
-
One simple workaround would be to use tokio's mutex which can be held across an await https://docs.rs/tokio/latest/tokio/sync/struct.Mutex.html (also re-exported as |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Hellager
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One simple workaround would be to use tokio's mutex which can be held across an await https://docs.rs/tokio/latest/tokio/sync/struct.Mutex.html (also re-exported as
tauri::async_runtime::Mutex