Function core::mem::align_of_val
[−]
[src]
pub fn align_of_val<T>(_val: &T) -> usize
Returns the alignment of the type of the value that _val
points to.
This is similar to align_of
, but function will properly handle types such as trait objects
(in the future), returning the alignment for an arbitrary value at runtime.
Examples
fn main() { use std::mem; assert_eq!(4, mem::align_of_val(&5i32)); }use std::mem; assert_eq!(4, mem::align_of_val(&5i32));