Primitive Backend Communication

This commit is contained in:
Neshura 2023-11-01 20:21:59 +01:00
parent 2b5a19fdd6
commit 9a8f2198f1
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
7 changed files with 373 additions and 18 deletions
src-tauri/src

View file

@ -1,6 +1,11 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use serde::{Deserialize, Serialize};
use crate::metadata::{*};
mod metadata;
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
@ -9,7 +14,12 @@ fn greet(name: &str) -> String {
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![greet])
.invoke_handler(tauri::generate_handler![greet, test])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
#[tauri::command]
fn test(message: metadata::Metadata) -> String {
format!("Series: '{}' | Title: '{}'", message.series_title, message.title)
}