use std::{fmt::Debug, marker::PhantomData}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use thiserror::Error; use crate::{object::GiteratedObject, operation::GiteratedOperation}; use super::Setting; #[derive(Serialize, Deserialize, Debug, Clone)] pub struct GetSetting { pub setting_name: String, pub _marker: PhantomData, } impl GiteratedOperation for GetSetting { fn operation_name() -> &'static str { "get_setting" } type Success = S; type Failure = GetSettingError; } #[derive(Error, Debug, Serialize, Deserialize)] pub enum GetSettingError {} #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(bound(deserialize = "S: Setting"))] pub struct SetSetting { pub setting_name: String, pub value: S, } impl GiteratedOperation for SetSetting { fn operation_name() -> &'static str { "set_setting" } type Success = (); type Failure = SetSettingError; } #[derive(Error, Debug, Serialize, Deserialize)] pub enum SetSettingError {}