Move notes store to rust
This commit is contained in:
parent
849400cf35
commit
75f3a84e5f
12 changed files with 617 additions and 138 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue