summaryrefslogtreecommitdiffstats
path: root/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/state.rs b/src/state.rs
new file mode 100644
index 0000000..723c8c1
--- /dev/null
+++ b/src/state.rs
@@ -0,0 +1,26 @@
+use std::collections::HashMap;
+
+use types::util::IPFSHash;
+use types::util::IPNSHash;
+
+/// TODO: Use rustbreak for persistence layer
+#[derive(Serialize, Deserialize, Debug)]
+pub struct AppState(HashMap<IPFSKeyName, Data>);
+
+#[derive(Serialize, Deserialize, Debug, Hash, PartialEq, Eq)]
+pub struct IPFSKeyName(String);
+
+#[derive(Serialize, Deserialize, Debug)]
+pub struct Data {
+ profile_cache: Vec<ProfileData>,
+ connect_nodes: Vec<IPFSHash>, // TODO: stronger type?
+}
+
+#[derive(Serialize, Deserialize, Debug)]
+pub struct ProfileData {
+ names: Vec<IPNSHash>,
+ follow: bool,
+ block: bool,
+ knownnames: Vec<String>,
+}
+