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

ambee/giterated

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

Fixed imports!

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨ef0e853

⁨giterated-models/src/repository/values.rs⁩ - ⁨1101⁩ bytes
Raw
1 use serde::{Deserialize, Serialize};
2
3 use crate::{settings::Setting, value::GiteratedObjectValue};
4
5 use super::{Repository, RepositoryVisibility};
6
7 // pub struct RepositorySetting<V: GiteratedObjectValue>(pub V);
8
9 // impl<O: GiteratedObject, V: GiteratedObjectValue<Object = O> + Send> GiteratedOperation<O>
10 // for RepositorySetting<V>
11 // {
12 // fn operation_name(&self) -> &'static str {
13 // "setting_get"
14 // }
15 // type Success = V;
16 // type Failure = GetValueError;
17 // }
18
19 #[derive(Debug, Hash, Clone, PartialEq, Eq, Serialize, Deserialize)]
20 pub struct Description(pub String);
21
22 impl GiteratedObjectValue for Description {
23 type Object = Repository;
24
25 fn value_name() -> &'static str {
26 "description"
27 }
28 }
29
30 impl Setting for Description {
31 fn name() -> &'static str {
32 "description"
33 }
34 }
35
36 #[derive(Debug, Hash, Clone, PartialEq, Eq, Serialize, Deserialize)]
37 pub struct Visibility(pub RepositoryVisibility);
38
39 impl GiteratedObjectValue for Visibility {
40 type Object = Repository;
41
42 fn value_name() -> &'static str {
43 "visibility"
44 }
45 }
46