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

ambee/giterated

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

Spinning

Amber - ⁨1⁩ year ago

parent: tbd commit: ⁨1788060

⁨giterated-core/giterated-models/src/settings/mod.rs⁩ - ⁨522⁩ bytes
Raw
1 mod operations;
2
3 pub use operations::*;
4 use serde::{de::DeserializeOwned, Serialize};
5
6 pub trait Setting: Serialize + DeserializeOwned + Send + Sync {
7 fn name() -> &'static str;
8 }
9
10 #[derive(Clone, Copy, Hash, PartialEq, Eq, Debug)]
11 pub struct ObjectSettingPair<'s> {
12 pub object_kind: &'s str,
13 pub setting_name: &'s str,
14 }
15
16 impl<'s> ObjectSettingPair<'s> {
17 pub fn new(object_kind: &'s str, setting_name: &'s str) -> Self {
18 Self {
19 object_kind,
20 setting_name,
21 }
22 }
23 }
24