pub fn serialize(&self) -> Vec<u8> {
        let mut data = self.body.join("\0").as_bytes().to_vec();

        let mut buffer = Vec::new();
        let input: (u8, u16, u16) = (self.mtype as u8, self.id, data.len() as u16);

        ProtocolHeader::write_to(input, &mut buffer).unwrap();
        buffer.append(&mut data);
        buffer
    }
/// Converts the `Message` into byte array
Converts the `Message` into byte array
Converts the ` Message ` into byte array
pub fn serialize(&self) -> Vec<u8> {
        let mut data = self.body.join("\0").as_bytes().to_vec();
        let mut buffer = Vec::new();
        let input: (u8, u16, u16) = (self.mtype as u8, self.id, data.len() as u16);
        ProtocolHeader::write_to(input, &mut buffer).unwrap();
        buffer.append(&mut data);
        buffer
    }
pub fn serialize ( & self ) -> Vec < u8 > { let mut data = self . body . join ( " \0 " ) . as_bytes ( ) . to_vec ( ) ; let mut buffer = Vec :: new ( ) ; let input : ( u8 , u16 , u16 ) = ( self . mtype as u8 , self . id , data . len ( ) as u16 ) ; ProtocolHeader :: write_to ( input , & mut buffer ) . unwrap ( ) ; buffer . append ( & mut data ) ; buffer }
Converts the `Message` into byte array
Converts the ` Message ` into byte array
&self
&self