#How to invoke command from Rust
5 messages · Page 1 of 1 (latest)
hmm, you can't really "just" invoke a command from the rust side. Rust isn't "dynamic" enough for that.
the closes thing, if you can't move around an AppHandle manually, is to store a global-ish AppHandle in a OnceCell from the setup hook (the earliest point in time where you can get one)
then you can use that apphandle to get AppHandle, Window, and State for the command which you call like a regular rust function at that point.
I have an AppHandle<A> available from builder.on_menu_event(|app| ...) which is generic over A, but I want to call a command which needs a AppHandle<tauri_runtime_wry::Wry<EventLoopMessage>> how can I upgrade my handle?