2022-12-12 23:37:28 +11:00
|
|
|
use uuid::Uuid;
|
|
|
|
use serde::*;
|
|
|
|
|
2022-12-12 23:35:55 +11:00
|
|
|
#[derive(Serialize, Deserialize, Clone, Debug)]
|
2022-12-12 23:37:28 +11:00
|
|
|
pub enum MessageFromListener {
|
|
|
|
ListenerPing { uuid: Uuid },
|
|
|
|
UserConnected { user: Uuid, source: String },
|
|
|
|
UserDisconnected { user: Uuid },
|
|
|
|
UserSentLine { user: Uuid, msg: String },
|
2022-12-12 23:35:55 +11:00
|
|
|
AcknowledgeMessage
|
2022-12-12 23:37:28 +11:00
|
|
|
}
|
|
|
|
|
2022-12-12 23:35:55 +11:00
|
|
|
#[derive(Serialize, Deserialize, Clone, Debug)]
|
2022-12-12 23:37:28 +11:00
|
|
|
pub enum MessageToListener {
|
|
|
|
DisconnectUser { user: Uuid },
|
|
|
|
SendToUser { user: Uuid, msg: String },
|
2022-12-12 23:35:55 +11:00
|
|
|
AcknowledgeMessage
|
2022-12-12 23:37:28 +11:00
|
|
|
}
|