1 |
use serde::{Deserialize, Serialize};
|
2 |
|
3 |
pub trait Setting: Serialize {
|
4 |
fn name() -> &'static str;
|
5 |
}
|
6 |
|
7 |
#[derive(Debug, Serialize, Deserialize)]
|
8 |
pub struct UserBio(pub String);
|
9 |
|
10 |
impl Setting for UserBio {
|
11 |
fn name() -> &'static str {
|
12 |
"Bio"
|
13 |
}
|
14 |
}
|
15 |
|
16 |
#[derive(Debug, Serialize, Deserialize)]
|
17 |
pub struct UserDisplayName(pub String);
|
18 |
|
19 |
impl Setting for UserDisplayName {
|
20 |
fn name() -> &'static str {
|
21 |
"Display Name"
|
22 |
}
|
23 |
}
|
24 |
|