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