diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2020-10-16 01:35:59 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2020-10-16 01:35:59 +0200 |
| commit | 18a3c0b3cf8254b70857e31ddd2b6213b10db156 (patch) | |
| tree | 07f7020aaf096b0ed58792ad78527d34f94e4f96 /mumlib/src/command.rs | |
| parent | 8e4eb0afcd0541c6732ebec71af76f3962f590cc (diff) | |
| parent | d35c9171271110339504abd96065dc25e1290500 (diff) | |
| download | mum-18a3c0b3cf8254b70857e31ddd2b6213b10db156.tar.gz | |
Merge branch 'cli' into 'main'
mumctl
See merge request gustav/mum!2
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..b2ac321 --- /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, + }, + ServerDisconnect, + Status, +} + +#[derive(Debug, Deserialize, Serialize)] +pub enum CommandResponse { + ChannelList { + channels: HashMap<u32, Channel>, + }, + Status { + username: Option<String>, + server_state: Server, + }, +} |
