use std::{collections::BTreeMap, fmt::Display}; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug)] #[serde(tag = "type")] pub enum Commands { ScheduleTask { task: String, properties: BTreeMap, }, } impl Display for Commands { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str(match self { Commands::ScheduleTask { .. } => "schedule_task", }) } }