2019-07-14 15:47:29 +03:00
|
|
|
mod cmd;
|
|
|
|
|
2019-08-16 13:58:30 +03:00
|
|
|
#[macro_use]
|
|
|
|
extern crate serde_derive;
|
2019-10-07 21:36:56 +03:00
|
|
|
extern crate serde_json;
|
2019-07-14 15:47:29 +03:00
|
|
|
|
2019-08-16 13:58:30 +03:00
|
|
|
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);
|
2019-07-14 15:47:29 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.build()
|
2019-08-16 13:58:30 +03:00
|
|
|
.run();
|
2019-07-14 15:47:29 +03:00
|
|
|
}
|