aboutsummaryrefslogtreecommitdiffstats
path: root/src/protocol.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-04-12 01:40:46 -0400
committerJesse Luehrs <doy@tozt.net>2020-04-12 01:40:46 -0400
commite45e35125e623a8fb683a28f55ad96d42d01a1d0 (patch)
treeffdf2130cb2197bc3e0769b732dfb4fc933b4618 /src/protocol.rs
parent14b647f9d6dbb76960e6cad6f51531ea6a8dbf3a (diff)
downloadrbw-e45e35125e623a8fb683a28f55ad96d42d01a1d0.tar.gz
rbw-e45e35125e623a8fb683a28f55ad96d42d01a1d0.zip
rename some stuff to be less confusing
Diffstat (limited to 'src/protocol.rs')
-rw-r--r--src/protocol.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/protocol.rs b/src/protocol.rs
new file mode 100644
index 0000000..8d7cd69
--- /dev/null
+++ b/src/protocol.rs
@@ -0,0 +1,27 @@
+#[derive(serde::Serialize, serde::Deserialize, Debug)]
+pub struct Request {
+ pub tty: Option<String>,
+ pub action: Action,
+}
+
+#[derive(serde::Serialize, serde::Deserialize, Debug)]
+#[serde(tag = "type")]
+pub enum Action {
+ Login,
+ Unlock,
+ Lock,
+ Sync,
+ Decrypt { cipherstring: String },
+ // add
+ // update
+ // remove
+ Quit,
+}
+
+#[derive(serde::Serialize, serde::Deserialize, Debug)]
+#[serde(tag = "type")]
+pub enum Response {
+ Ack,
+ Error { error: String },
+ Decrypt { plaintext: String },
+}