use std::{any::type_name, fmt::Debug}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value; use crate::object::GiteratedObject; pub trait GiteratedOperation: Send + Serialize + DeserializeOwned { type Success: Serialize + DeserializeOwned + Send; type Failure: Serialize + DeserializeOwned + Send; fn operation_name() -> &'static str { type_name::() } } #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(transparent)] #[repr(transparent)] pub struct AnyOperation(pub Value); impl GiteratedOperation for AnyOperation { type Success = Value; type Failure = Value; }