25 lines
		
	
	
		
			664 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			664 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| #![cfg_attr(
 | |
|     all(not(debug_assertions), target_os = "linux"),
 | |
|     windows_subsystem = "windows"
 | |
| )]
 | |
| 
 | |
| extern crate ip_lib;
 | |
| 
 | |
| // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
 | |
| #[tauri::command]
 | |
| fn greet(name: &str) -> String {
 | |
|     format!("Hello, {}! You've been greeted from Rust!", name)
 | |
| }
 | |
| 
 | |
| #[tauri::command]
 | |
| fn get_version() -> String {
 | |
|     return option_env!("CARGO_PKG_VERSION").unwrap_or("x.x.x").to_string();
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     tauri::Builder::default()
 | |
|         .invoke_handler(tauri::generate_handler![greet,get_version])
 | |
|         .run(tauri::generate_context!())
 | |
|         .expect("error while running tauri application");
 | |
| }
 |