summaryrefslogtreecommitdiffstats
path: root/src/state.rs
blob: 723c8c171a6aa8b2ab08a9bd729fdf20052193b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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>,
}