pub fn metadata<T: Pointee + ?Sized>(ptr: *const T) -> <T as Pointee>::Metadata
Expand description

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.

Example

use ptr_meta::metadata;

assert_eq!(metadata("foo"), 3_usize);