1 use super::prelude::*; 2 3 #[derive(Debug)] 4 pub struct qRcmd<'a> { 5 pub hex_cmd: &'a [u8], 6 } 7 8 impl<'a> ParseCommand<'a> for qRcmd<'a> { 9 #[inline(always)] from_packet(buf: PacketBuf<'a>) -> Option<Self>10 fn from_packet(buf: PacketBuf<'a>) -> Option<Self> { 11 crate::__dead_code_marker!("qRcmd", "from_packet"); 12 13 let body = buf.into_body(); 14 match body { 15 [] => Some(qRcmd { hex_cmd: &[] }), 16 [b',', hex_cmd @ ..] => Some(qRcmd { 17 hex_cmd: decode_hex_buf(hex_cmd).ok()?, 18 }), 19 _ => None, 20 } 21 } 22 } 23