summaryrefslogtreecommitdiff
path: root/src-tauri/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r--src-tauri/src/main.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
new file mode 100644
index 0000000..e937ebc
--- /dev/null
+++ b/src-tauri/src/main.rs
@@ -0,0 +1,30 @@
+#![cfg_attr(
+ all(not(debug_assertions), target_os = "windows"),
+ windows_subsystem = "windows"
+)]
+
+mod cmd;
+
+fn main() {
+ tauri::AppBuilder::new()
+ .invoke_handler(|_webview, arg| {
+ use cmd::Cmd::*;
+ match serde_json::from_str(arg) {
+ Err(e) => {
+ Err(e.to_string())
+ }
+ Ok(command) => {
+ match command {
+ // definitions for your custom commands from Cmd here
+ MyCustomCommand { argument } => {
+ // your command code
+ println!("{}", argument);
+ }
+ }
+ Ok(())
+ }
+ }
+ })
+ .build()
+ .run();
+}