vaulted/data/models/
accounts.rs

1/*
2   Appellation: accounts
3   Context:
4   Creator: FL03 <jo3mccain@icloud.com>
5   Description:
6       ... Summary ...
7*/
8
9#[derive(Clone, Debug, Hash, PartialEq, serde::Deserialize, serde::Serialize)]
10pub struct ApiToken {
11    pub label: String,
12    pub key: String,
13    pub secret: String,
14}
15
16#[derive(Clone, Debug, Hash, PartialEq, serde::Deserialize, serde::Serialize)]
17pub struct Account {
18    pub username: String,
19    pub password: String,
20    pub data: Vec<ApiToken>,
21}
22
23#[cfg(test)]
24mod tests {
25    #[test]
26    fn test() {
27        let f = |x: usize| x.pow(x.try_into().unwrap());
28        assert_eq!(f(2), 4)
29    }
30}