• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use super::prelude::*;
2 
3 #[derive(Debug)]
4 pub struct z<'a> {
5     pub type_: u8,
6     pub addr: &'a [u8],
7     pub kind: u8,
8 }
9 
10 impl<'a> ParseCommand<'a> for z<'a> {
from_packet(buf: PacketBuf<'a>) -> Option<Self>11     fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
12         let body = buf.into_body();
13         let mut body = body.split_mut(|&b| b == b',');
14         let type_ = decode_hex(body.next()?).ok()?;
15         let addr = decode_hex_buf(body.next()?).ok()?;
16         let kind = decode_hex(body.next()?).ok()?;
17 
18         Some(z { type_, addr, kind })
19     }
20 }
21