pub fn continuation<T: Into<Bytes>>(
        channel: u32,
        sequence: u8,
        payload: T,
    ) -> Result<Self, Error> {
        let payload_bytes = payload.into();
        if payload_bytes.len() > (MAX_PACKET_LENGTH - CONT_HEADER_LENGTH) as usize {
            return Err(format_err!("Continuation packet payload exceeded max length"));
        } else if payload_bytes.len() == 0 {
            return Err(format_err!("Continuation packet did not contain any data"));
        } else if sequence & 0x80 != 0 {
            return Err(format_err!("Continuation packet has sequence number with MSB set"));
        }
        Ok(Self::Continuation { channel, sequence, payload: payload_bytes })
    }
/// Creates a new continuation packet.
Creates a new continuation packet.
Creates a new continuation packet .
pub fn continuation<T: Into<Bytes>>(
        channel: u32,
        sequence: u8,
        payload: T,
    ) -> Result<Self, Error> {
        let payload_bytes = payload.into();
        if payload_bytes.len() > (MAX_PACKET_LENGTH - CONT_HEADER_LENGTH) as usize {
            return Err(format_err!("Continuation packet payload exceeded max length"));
        } else if payload_bytes.len() == 0 {
            return Err(format_err!("Continuation packet did not contain any data"));
        } else if sequence & 0x80 != 0 {
            return Err(format_err!("Continuation packet has sequence number with MSB set"));
        }
        Ok(Self::Continuation { channel, sequence, payload: payload_bytes })
    }
pub fn continuation < T : Into < Bytes > > ( channel : u32 , sequence : u8 , payload : T , ) -> Result < Self , Error > { let payload_bytes = payload . into ( ) ; if payload_bytes . len ( ) > ( MAX_PACKET_LENGTH - CONT_HEADER_LENGTH ) as usize { return Err ( format_err ! ( " " ) ) ; } else if payload_bytes . len ( ) == 0 { return Err ( format_err ! ( " " ) ) ; } else if sequence & 0x80 != 0 { return Err ( format_err ! ( " " ) ) ; } Ok ( Self :: Continuation { channel , sequence , payload : payload_bytes } ) }
Creates a new continuation packet.
Creates a new continuation packet .
channel
u32
sequence
u8
payload
T