kittycad_modeling_cmds/
traits.rsuse schemars::JsonSchema;
use serde::{de::DeserializeOwned, Serialize};
use crate::ModelingCmd;
pub trait ModelingCmdVariant: Serialize {
type Output: ModelingCmdOutput;
fn into_enum(self) -> ModelingCmd;
fn name() -> &'static str;
}
pub trait ModelingCmdOutput: std::fmt::Debug + Serialize + DeserializeOwned + JsonSchema {}
impl<CmdVariant> From<CmdVariant> for ModelingCmd
where
CmdVariant: ModelingCmdVariant,
{
fn from(value: CmdVariant) -> Self {
value.into_enum()
}
}