Method lrs::vec::Vec::from_raw_parts

Creates a new vector from its raw parts.

Syntax

impl<T, H> Vec<T, H>
    where H: Allocator,
{
    unsafe fn from_raw_parts(ptr: *mut T, len: usize, cap: usize, pool: <H as Allocator>::Pool) -> Vec<T, H>
}

Arguments

NameDescription
ptr

The pointer to the first element of the vector.

len

The number of elements in the vector.

cap

The capacity of the array pointed to by the pointer.

pool

Remarks

The allocator must be the same allocator that was used to allocate the memory.