mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
27 lines
554 B
Rust
27 lines
554 B
Rust
mod cmd;
|
|
|
|
#[macro_use]
|
|
extern crate serde_derive;
|
|
extern crate serde_json;
|
|
|
|
fn main() {
|
|
tauri::AppBuilder::new()
|
|
.invoke_handler(|_webview, arg| {
|
|
use cmd::Cmd::*;
|
|
match serde_json::from_str(arg) {
|
|
Err(_) => {}
|
|
Ok(command) => {
|
|
match command {
|
|
// definitions for your custom commands from Cmd here
|
|
MyCustomCommand { argument } => {
|
|
// your command code
|
|
println!("{}", argument);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
.build()
|
|
.run();
|
|
}
|