Private
Public Access
1
0
Files
Kordophone/kordophoned/src/daemon/events.rs

26 lines
655 B
Rust
Raw Normal View History

use tokio::sync::oneshot;
use kordophone_db::models::Conversation;
use crate::daemon::settings::Settings;
pub type Reply<T> = oneshot::Sender<T>;
#[derive(Debug)]
pub enum Event {
/// Get the version of the daemon.
GetVersion(Reply<String>),
/// Asynchronous event for syncing all conversations with the server.
SyncAllConversations(Reply<()>),
/// Returns all known conversations from the database.
GetAllConversations(Reply<Vec<Conversation>>),
/// Returns all known settings from the database.
GetAllSettings(Reply<Settings>),
/// Update settings in the database.
UpdateSettings(Settings, Reply<()>),
}