Function memory_units::size_of[][src]

pub fn size_of<T>() -> Bytes

Returns the size of a type in Bytes.

Example

#[repr(C)]
struct Hello {
    a: u32,
    b: u32,
}

assert_eq!(size_of::<Hello>(), Bytes(4 + 4));