Files
morethantext/src/messages.rs
2024-05-12 14:22:11 -04:00

22 lines
494 B
Rust

/// These are the nessages that are used by the database.
use std::sync::mpsc::Sender;
use uuid::Uuid;
/// Requests of the database.
pub enum SendMsg {
OpenSession(SessionRequest),
}
/// Responses to database requests
pub enum ReceiveMsg {
Session(Uuid),
}
/// Items needed for a session request.
pub struct SessionRequest {
/// Optional string reprosentation of the session id.
pub id: Option<String>,
/// Channel Sender for the reply.
pub tx: Sender<ReceiveMsg>,
}