use serde::Serialize; use super::Payload; use utils::nonce; #[derive(Debug, Default, Serialize)] pub struct Command where T: Serialize { pub nonce: String, pub cmd: String, pub args: T, } impl Command where T: Serialize { pub fn new(cmd: S, args: T) -> Self where S: Into { Command { cmd: cmd.into(), nonce: nonce(), args: args } } } impl Payload for Command where T: Serialize {}