( ), , :
let buf = [1u8, 2, 3, 4];
// Transmute 4 byte array into u32
let length = unsafe {
let length = std::mem::transmute::<[u8; 4], u32>(buf); // buf is the 4 item array of u8 that the socket was read into
println!("1: {:}", length);
length
};
println!("Length: {:}", length);
:
let length = unsafe {std::mem::transmute::<[u8; 4], u32>(buf)};