pub fn metadata<T: ?Sized>(ptr: *const T) -> <T as Pointee>::Metadata
ptr_metadata
Extract the metadata component of a pointer.
Values of type *mut T, &T, or &mut T can be passed directly to this function as they implicitly coerce to *const T.
*mut T
&T
&mut T
*const T
#![feature(ptr_metadata)] assert_eq!(std::ptr::metadata("foo"), 3_usize);