use std::{any::type_name, fmt::Debug}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use crate::object::GiteratedObject; pub trait GiteratedOperation: Send + Sync + 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 NetworkAnyOperation(pub Vec); impl GiteratedOperation for NetworkAnyOperation { type Success = Vec; type Failure = Vec; } /// The internal state of an operation, used to provide authentication information /// and the ability to make giterated calls within handlers. #[derive(Clone)] pub struct GiteratedOperationState(pub S);