aboutsummaryrefslogtreecommitdiffstats
path: root/mumlib/src/command.rs
diff options
context:
space:
mode:
authorEskil Queseth <eskilq@kth.se>2020-10-15 21:21:55 +0200
committerEskil Queseth <eskilq@kth.se>2020-10-15 21:21:55 +0200
commit01b3c75420ec5bf9083dbcf643d3c6087d4f2ce7 (patch)
tree4a6dd760ad39974fc8684fe76400b5dee8967c37 /mumlib/src/command.rs
parent680c46e6866071ae987d9978316ce2952347fe35 (diff)
parent47d3834a6e5b82e287b975fbf55939c6fd44ca02 (diff)
downloadmum-01b3c75420ec5bf9083dbcf643d3c6087d4f2ce7.tar.gz
Merge remote-tracking branch 'origin/cli' into error-handling
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..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,
+ },
+}