project restructure with Rust workspaces

This commit is contained in:
Priler 2026-01-04 05:19:47 +05:00
parent 3ffbe876f3
commit 09f72622bc
428 changed files with 19372 additions and 6061 deletions

View file

@ -0,0 +1,41 @@
use tauri::Emitter;
// the payload type must implement `Serialize` and `Clone`.
#[derive(Clone, serde::Serialize)]
pub struct Payload {
pub data: String,
}
#[allow(dead_code)]
pub enum EventTypes {
AudioPlay,
AssistantWaiting,
AssistantGreet,
CommandStart,
CommandInProcess,
CommandEnd,
}
impl EventTypes {
pub fn get(&self) -> &str {
match self {
Self::AudioPlay => "audio-play",
Self::AssistantWaiting => "assistant-waiting",
Self::AssistantGreet => "assistant-greet",
Self::CommandStart => "command-start",
Self::CommandInProcess => "command-in-process",
Self::CommandEnd => "command-end",
}
}
}
pub fn play(phrase: &str, app_handle: &tauri::AppHandle) {
app_handle
.emit(
EventTypes::AudioPlay.get(),
Payload {
data: phrase.into(),
},
)
.unwrap();
}