SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pub struct ControlPacket {
  2.     type_and_flags: u8,
  3.     length: u16,
  4.     variable_header: Option<Vec<u8>>,
  5.     properties: Option<Vec<u8>>,
  6.     payload: Option<Vec<u8>>,
  7. }
  8.  
  9. impl<'a> From<&'a ControlPacket> for &'a [u8] {
  10.     fn from(packet: &'a ControlPacket) -> &'a [u8] {
  11.         packet.payload.as_ref().unwrap()
  12.     }
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top