wasmer_types::lib::std::ptr

Function metadata

const: 1.83.0 · source
pub const fn metadata<T>(ptr: *const T) -> <T as Pointee>::Metadata
where T: ?Sized,
🔬This is a nightly-only experimental API. (ptr_metadata)
Available on crate feature std only.
Expand description

Extracts 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);