Move notes store to rust

This commit is contained in:
Joscha 2025-02-13 22:20:56 +01:00
parent 849400cf35
commit 75f3a84e5f
12 changed files with 617 additions and 138 deletions

View file

@ -1,16 +1,28 @@
mod ids;
use std::sync::{Arc, Mutex};
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
use store::Store;
mod api;
mod ids;
pub mod store;
mod types;
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![greet])
.manage(Arc::new(Mutex::new(Store::new())))
.invoke_handler(tauri::generate_handler![
api::note_child_add,
api::note_child_move,
api::note_child_remove,
api::note_children_set,
api::note_create,
api::note_delete,
api::note_get,
api::note_text_set,
api::notes_clear,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}