• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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> {
from_packet(buf: PacketBuf<'a>) -> Option<Self>9     fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
10         crate::__dead_code_marker!("qRcmd", "from_packet");
11 
12         let body = buf.into_body();
13         match body {
14             [] => Some(qRcmd { hex_cmd: &[] }),
15             [b',', hex_cmd @ ..] => Some(qRcmd {
16                 hex_cmd: decode_hex_buf(hex_cmd).ok()?,
17             }),
18             _ => None,
19         }
20     }
21 }
22