feat: updtes

This commit is contained in:
2024-08-19 23:59:12 +08:00
parent 7c3459fa24
commit be3733fe54
7 changed files with 59 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
# Generated by Cargo
# will have compiled files and executables
/.idea/
/target/
# Generated by Tauri

View File

@@ -1,15 +1,26 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
fn read_content() -> String {
// TODO ...
let args: Vec<String> = std::env::args().collect();
args.join(", ")
}
#[tauri::command]
fn save_content(name: &str) -> String {
// TOD save....
format!("Hello, {}! You've been greeted from Rust!", name)
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![greet])
.invoke_handler(tauri::generate_handler![
read_content,
save_content,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}