diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2020-10-15 21:02:44 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2020-10-15 21:02:44 +0200 |
| commit | 47d3834a6e5b82e287b975fbf55939c6fd44ca02 (patch) | |
| tree | 7e3a79a2ab9ebf7fc3b0bbc5ac575e086e86eea2 /mumlib/src/command.rs | |
| parent | de856d5e43ecadcd876bdf03800ecc5421347872 (diff) | |
| download | mum-47d3834a6e5b82e287b975fbf55939c6fd44ca02.tar.gz | |
add mumlib
Diffstat (limited to 'mumlib/src/command.rs')
| -rw-r--r-- | mumlib/src/command.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mumlib/src/command.rs b/mumlib/src/command.rs new file mode 100644 index 0000000..483d8c6 --- /dev/null +++ b/mumlib/src/command.rs @@ -0,0 +1,31 @@ +use crate::state::{Channel, Server}; + +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; + +#[derive(Clone, Debug, Deserialize, Serialize)] +pub enum Command { + ChannelJoin { + channel_id: u32, + }, + ChannelList, + ServerConnect { + host: String, + port: u16, + username: String, + accept_invalid_cert: bool, //TODO ask when connecting + }, + ServerDisconnect, + Status, +} + +#[derive(Debug, Deserialize, Serialize)] +pub enum CommandResponse { + ChannelList { + channels: HashMap<u32, Channel>, + }, + Status { + username: Option<String>, + server_state: Server, + }, +} |
