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 },
|
2022-12-12 23:36:07 +11:00
|
|
|
SessionConnected { session: Uuid, source: String },
|
|
|
|
SessionDisconnected { session: Uuid },
|
|
|
|
SessionSentLine { session: 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 {
|
2022-12-12 23:36:07 +11:00
|
|
|
DisconnectSession { session: Uuid },
|
|
|
|
SendToSession { session: Uuid, msg: String },
|
2022-12-12 23:35:55 +11:00
|
|
|
AcknowledgeMessage
|
2022-12-12 23:37:28 +11:00
|
|
|
}
|