summaryrefslogtreecommitdiff
path: root/src-tauri/src/main.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-02-21 18:30:25 -0800
committerGitHub <[email protected]>2021-02-21 18:30:25 -0800
commit1a8d4449192b17c67f615faef44a1993efbac142 (patch)
tree3732be235698b60ba71622a95da719bc2480de0f /src-tauri/src/main.rs
downloadtauri-vue-master.tar.xz
tauri-vue-master.zip
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();
+}