1 use super::prelude::*; 2 use crate::target::ext::host_io::FsKind; 3 4 #[derive(Debug)] 5 pub struct vFileSetfs { 6 pub fs: FsKind, 7 } 8 9 impl<'a> ParseCommand<'a> for vFileSetfs { 10 #[inline(always)] from_packet(buf: PacketBuf<'a>) -> Option<Self>11 fn from_packet(buf: PacketBuf<'a>) -> Option<Self> { 12 let body = buf.into_body(); 13 if body.is_empty() { 14 return None; 15 } 16 17 match body { 18 [b':', body @ ..] => { 19 let fs = match crate::common::Pid::new(decode_hex(body).ok()?) { 20 None => FsKind::Stub, 21 Some(pid) => FsKind::Pid(pid), 22 }; 23 Some(vFileSetfs { fs }) 24 } 25 _ => None, 26 } 27 } 28 } 29