use serde::Deserialize; use serde::Serialize; #[derive(Debug, Serialize)] pub struct Request { method: String, tag: u8, pub arguments: T } impl Request { pub fn new(method: impl ToString, tag: u8, arguments: T) -> Self { Self{ method: method.to_string(), tag: tag, arguments: arguments } } } #[derive(Debug, Deserialize)] pub struct Response { result: String, tag: u8, pub arguments: T }