Macro tauri_macros::generate_handler
source · generate_handler!() { /* proc-macro */ }
Expand description
Accepts a list of commands functions. Creates a handler that allows commands to be called from JS with invoke().
§Examples
ⓘ
use tauri_macros::{command, generate_handler};
#[command]
fn command_one() {
println!("command one called");
}
#[command]
fn command_two() {
println!("command two called");
}
fn main() {
let _handler = generate_handler![command_one, command_two];
}
§Stability
The output of this macro is managed internally by Tauri, and should not be accessed directly on normal applications. It may have breaking changes in the future.