tauri_macros

Macro generate_handler

Source
generate_handler!() { /* proc-macro */ }
Expand description

Accepts a list of command 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.