• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use super::prelude::*;
2 
3 #[derive(Debug)]
4 pub struct vFileUnlink<'a> {
5     pub filename: &'a [u8],
6 }
7 
8 impl<'a> ParseCommand<'a> for vFileUnlink<'a> {
9     #[inline(always)]
from_packet(buf: PacketBuf<'a>) -> Option<Self>10     fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
11         let body = buf.into_body();
12         if body.is_empty() {
13             return None;
14         }
15 
16         match body {
17             [b':', body @ ..] => {
18                 let filename = decode_hex_buf(body).ok()?;
19                 Some(vFileUnlink { filename })
20             }
21             _ => None,
22         }
23     }
24 }
25