Function from_raw_parts

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

Returns a raw pointer with the given data address and metadata.

This function is safe, but the returned pointer is not necessarily safe to dereference. For slices, see the documentation of slice::from_raw_parts for safety requirements. For trait objects, the metadata must come from a a trait object with the same underlying type.