forked from kamat/tauclock
22 lines
857 B
Rust
22 lines
857 B
Rust
//! Core TauClock backend that wires plugins and exposes Rust commands.
|
|
//!
|
|
//! The UI currently uses only frontend logic, but the scaffold is documented
|
|
//! so contributors know where to extend native capabilities (timers, IPC, etc).
|
|
|
|
/// Example command exposed to the frontend. Extend or replace as needed.
|
|
#[tauri::command]
|
|
fn greet(name: &str) -> String {
|
|
format!("Hello, {}! You've been greeted from Rust!", name)
|
|
}
|
|
|
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
/// Build the Tauri application, attach plugins, and start the runtime loop.
|
|
pub fn run() {
|
|
tauri::Builder::default()
|
|
.plugin(tauri_plugin_log::Builder::new().build())
|
|
.plugin(tauri_plugin_opener::init())
|
|
.invoke_handler(tauri::generate_handler![greet])
|
|
.run(tauri::generate_context!())
|
|
.expect("error while running tauri application");
|
|
}
|