pub fn initialization<T: Into<Bytes>>(
        channel: u32,
        command: Command,
        message_length: u16,
        payload: T,
    ) -> Result<Self, Error> {
        let payload_bytes = payload.into();
        if payload_bytes.len() > (MAX_PACKET_LENGTH - INIT_HEADER_LENGTH) as usize {
            return Err(format_err!("Initialization packet payload exceeded max length"));
        }
        Ok(Self::Initialization { channel, command, message_length, payload: payload_bytes })
    }
/// Creates a new initialization packet.
Creates a new initialization packet.
Creates a new initialization packet .
pub fn initialization<T: Into<Bytes>>(
        channel: u32,
        command: Command,
        message_length: u16,
        payload: T,
    ) -> Result<Self, Error> {
        let payload_bytes = payload.into();
        if payload_bytes.len() > (MAX_PACKET_LENGTH - INIT_HEADER_LENGTH) as usize {
            return Err(format_err!("Initialization packet payload exceeded max length"));
        }
        Ok(Self::Initialization { channel, command, message_length, payload: payload_bytes })
    }
pub fn initialization < T : Into < Bytes > > ( channel : u32 , command : Command , message_length : u16 , payload : T , ) -> Result < Self , Error > { let payload_bytes = payload . into ( ) ; if payload_bytes . len ( ) > ( MAX_PACKET_LENGTH - INIT_HEADER_LENGTH ) as usize { return Err ( format_err ! ( " " ) ) ; } Ok ( Self :: Initialization { channel , command , message_length , payload : payload_bytes } ) }
Creates a new initialization packet.
Creates a new initialization packet .
channel
u32
command
Command
message_length
u16
payload
T