| 1 |
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/ |
| 2 |
mod folder_manager; |
| 3 |
|
| 4 |
use folder_manager::{ |
| 5 |
get_default_storage_suggestions, |
| 6 |
validate_storage_folder, |
| 7 |
create_storage_folder, |
| 8 |
get_storage_status, |
| 9 |
remove_storage_data |
| 10 |
}; |
| 11 |
|
| 12 |
#[tauri::command] |
| 13 |
fn greet(name: &str) -> String { |
| 14 |
format!("Hello, {}! You've been greeted from Rust!", name) |
| 15 |
} |
| 16 |
|
| 17 |
#[cfg_attr(mobile, tauri::mobile_entry_point)] |
| 18 |
pub fn run() { |
| 19 |
tauri::Builder::default() |
| 20 |
.plugin(tauri_plugin_opener::init()) |
| 21 |
.invoke_handler(tauri::generate_handler![ |
| 22 |
greet, |
| 23 |
get_default_storage_suggestions, |
| 24 |
validate_storage_folder, |
| 25 |
create_storage_folder, |
| 26 |
get_storage_status, |
| 27 |
remove_storage_data |
| 28 |
]) |
| 29 |
.run(tauri::generate_context!()) |
| 30 |
.expect("error while running tauri application"); |
| 31 |
} |
| 32 |
|