summaryrefslogtreecommitdiffstats
path: root/src/state.rs
blob: 46661b1448fb0d86b5310c6082a9dfabaf74d6c6 (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 crate::types::util::IPFSHash;
use crate::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>,
}