aboutsummaryrefslogtreecommitdiffstats
path: root/mumlib/src/command.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-10-16 01:35:59 +0200
committerGustav Sörnäs <gustav@sornas.net>2020-10-16 01:35:59 +0200
commit18a3c0b3cf8254b70857e31ddd2b6213b10db156 (patch)
tree07f7020aaf096b0ed58792ad78527d34f94e4f96 /mumlib/src/command.rs
parent8e4eb0afcd0541c6732ebec71af76f3962f590cc (diff)
parentd35c9171271110339504abd96065dc25e1290500 (diff)
downloadmum-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.rs31
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,
+ },
+}