JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Begin new protocol refactor

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨26651b1

⁨giterated-models/src/values/user.rs⁩ - ⁨905⁩ bytes
Raw
1 use serde::{Deserialize, Serialize};
2
3 use crate::{model::user::User, operation::GiteratedObjectValue};
4
5 // pub struct UserSetting<V: GiteratedObjectValue>(pub V);
6
7 // impl<O: GiteratedObject, V: GiteratedObjectValue<Object = O> + Send> GiteratedOperation<O>
8 // for UserSetting<V>
9 // {
10 // fn operation_name(&self) -> &'static str {
11 // "setting_get"
12 // }
13 // type Success = V;
14 // type Failure = GetValueError;
15 // }
16
17 #[derive(Debug, Hash, Clone, PartialEq, Eq, Serialize, Deserialize)]
18 pub struct Bio(pub String);
19
20 impl GiteratedObjectValue for Bio {
21 type Object = User;
22
23 fn value_name() -> &'static str {
24 "bio"
25 }
26 }
27
28 #[derive(Debug, Hash, Clone, PartialEq, Eq, Serialize, Deserialize)]
29 pub struct DisplayName(pub String);
30
31 impl GiteratedObjectValue for DisplayName {
32 type Object = User;
33
34 fn value_name() -> &'static str {
35 "display_name"
36 }
37 }
38