Function std::mem::size_of_val [] [src]

pub fn size_of_val<T>(val: &T) -> usize where T: ?Sized
1.0.0

Returns the size of the given value in bytes.

Examples

fn main() { use std::mem; assert_eq!(4, mem::size_of_val(&5i32)); }
use std::mem;

assert_eq!(4, mem::size_of_val(&5i32));