pub fn assert_initial(payload: &[u8], expect_token: bool) {
    let mut dec = Decoder::from(payload);
    let t = dec.decode_byte().unwrap();
    let version = assert_default_version(&mut dec);
    assert_long_packet_type(t, 0b1000_0000, version);
    dec.skip_vec(1); // Destination Connection ID.
    dec.skip_vec(1); // Source Connection ID.
    let token = dec.decode_vvec().unwrap();
    assert_eq!(expect_token, !token.is_empty());
}
/// Assert that this is an Initial packet with (or without) a token.
/// # Panics
/// If the tests fail.
Assert that this is an Initial packet with (or without) a token.
Assert that this is an Initial packet with ( or without ) a token .
pub fn assert_initial(payload: &[u8], expect_token: bool) {
    let mut dec = Decoder::from(payload);
    let t = dec.decode_byte().unwrap();
    let version = assert_default_version(&mut dec);
    assert_long_packet_type(t, 0b1000_0000, version);
    dec.skip_vec(1); // Destination Connection ID.
    dec.skip_vec(1); // Source Connection ID.
    let token = dec.decode_vvec().unwrap();
    assert_eq!(expect_token, !token.is_empty());
}
pub fn assert_initial ( payload : & [ u8 ] , expect_token : bool ) { let mut dec = Decoder :: from ( payload ) ; let t = dec . decode_byte ( ) . unwrap ( ) ; let version = assert_default_version ( & mut dec ) ; assert_long_packet_type ( t , 0b1000_0000 , version ) ; dec . skip_vec ( 1 ) ; // Destination Connection ID. dec . skip_vec ( 1 ) ; // Source Connection ID. let token = dec . decode_vvec ( ) . unwrap ( ) ; assert_eq ! ( expect_token token is_empty ( ) ) ; }
Assert that this is an Initial packet with (or without) a token.
Assert that this is an Initial packet with ( or without ) a token .
payload
&[u8]
expect_token
bool
panics
If the tests fail.
If the tests fail .