/// Returns a tuple containing the identifier, sequence number,
/// and send time (in milliseconds) for a packet's payload.
///
/// # Arguments
/// * `payload` - Payload of a packet.
Returns a tuple containing the identifier, sequence number,
and send time (in milliseconds) for a packet's payload.
Returns a tuple containing the identifier sequence number and send time ( in milliseconds ) for a packet ' s payload .
fn read_payload(payload: &[u8]) -> (u16, u16, u128) {
    let send_time = unsafe {
        let num = 0u128;
        let mut arr = mem::transmute::<u128, [u8; 16]>(num);
        arr.copy_from_slice(&payload[4..20]);
        mem::transmute::<[u8; 16], u128>(arr)
    };
    (
        payload[0] as u16 + ((payload[1] as u16) << 8), // identifier
        payload[2] as u16 + ((payload[3] as u16) << 8), // sequence number
        send_time,
    )
}
fn read_payload ( payload : & [ u8 ] ) -> ( u16 , u16 , u128 ) { let send_time = unsafe { let num = 0u128 ; let mut arr = mem :: transmute :: < u128 , [ u8 ; 16 ] > ( num ) ; arr . copy_from_slice ( & payload [ 4 .. 20 ] ) ; mem :: transmute :: < [ u8 ; 16 ] , u128 > ( arr ) } ; ( payload [ 0 ] as u16 + ( ( payload [ 1 ] as u16 ) << 8 ) , // identifier payload [ 2 ] as u16 + ( ( payload [ 3 ] as u16 ) << 8 ) , // sequence number send_time , ) }
Returns a tuple containing the identifier, sequence number,
and send time (in milliseconds) for a packet's payload.
Returns a tuple containing the identifier sequence number and send time ( in milliseconds ) for a packet ' s payload .
payload
&[u8]