1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
use std::collections::HashMap; trait Content {} trait Message { fn name(&self) -> String; } #[derive(Serialize)] pub struct Callback { pub path: Vec<String>, pub request: HashMap<String, String>, } impl Message for Callback { fn name(&self) -> String { String::from("CALLBACK") } }