Function std::ptr::metadata
pub fn metadata<T>(ptr: *const T) -> <T as Pointee>::Metadata where T: ?Sized,
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
#![feature(ptr_metadata)] assert_eq!(std::ptr::metadata("foo"), 3_usize);
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/ptr/fn.metadata.html