std::mem
pub fn size_of<T>() -> usize
Returns the size of a type in bytes.
use std::mem; assert_eq!(4, mem::size_of::<i32>());