consume core in Tauri

This commit is contained in:
polv committed 2026-02-21 23:33:10 +07:00
1 parent 876b879a65
commit 59968e0d6c
14 files changed
+157 -75

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
use cjdic2_core::{AppService, Entry};
#[tauri::command]
pub fn add_entry(name: &str, state: tauri::State<AppService>) -> Result<(), String> {
state
.add_entry(name, "definition")
.map_err(|e| e.to_string())
}
#[tauri::command]
pub fn list_entries(state: tauri::State<AppService>) -> Result<Vec<Entry>, String> {
state.list_entries().map_err(|e| e.to_string())
}