diff options
Diffstat (limited to 'kittybox-rs/src/database')
-rw-r--r-- | kittybox-rs/src/database/mod.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kittybox-rs/src/database/mod.rs b/kittybox-rs/src/database/mod.rs index 2039ac0..db0e360 100644 --- a/kittybox-rs/src/database/mod.rs +++ b/kittybox-rs/src/database/mod.rs @@ -48,6 +48,11 @@ pub mod settings { fn from(settings: Settings) -> Self { settings.site_name } + } + impl From<Settings> for Webring { + fn from(settings: Settings) -> Self { + settings.webring + } }*/ /// A trait for various settings that should be contained here. @@ -96,6 +101,21 @@ pub mod settings { } } + /// Participation status in the IndieWeb Webring: https://πΈπ.ws/dashboard + #[derive(Debug, Default, serde::Deserialize, serde::Serialize, Clone, Copy, PartialEq, Eq)] + pub struct Webring(bool); + impl private::Sealed for Webring {} + impl Setting<'_> for Webring { + type Data = bool; + const ID: &'static str = "webring"; + + fn into_inner(self) -> Self::Data { + self.0 + } + + fn new(data: Self::Data) -> Self { + Self(data) + } } } |