Feature gate: #![feature(box_vec_non_null)]
This is a tracking issue for convenience methods for conversion between NonNull and Vec/Box.
Public API
impl<T: ?Sized> Box<T> {
pub unsafe fn from_non_null(ptr: NonNull<T>) -> Self { .... }
pub fn into_non_null(b: Self) -> NonNull<T> { .... }
}
impl<T: ?Sized, A: Allocator> Box<T, A> {
pub const unsafe fn from_non_null_in(raw: NonNull<T>, alloc: A) -> Self { .... }
pub fn into_non_null_with_allocator(b: Self) -> (NonNull<T>, A) { .... }
}
impl<T> Vec<T> {
pub unsafe fn from_parts(ptr: NonNull<T>, length: usize, capacity: usize) -> Self { .... }
pub fn into_parts(self) -> (NonNull<T>, usize, usize) { .... }
}
impl<T, A: Allocator> Vec<T, A> {
pub unsafe fn from_parts_in(ptr: NonNull<T>, length: usize, capacity: usize, alloc: A) -> Self { .... }
pub fn into_parts_with_alloc(self) -> (NonNull<T>, usize, usize, A) { .... }
pub const fn as_non_null(&mut self) -> NonNull<T> { .... }
}
Steps / History
Unresolved Questions
Feature gate:
#![feature(box_vec_non_null)]This is a tracking issue for convenience methods for conversion between
NonNullandVec/Box.Public API
Steps / History
NonNullconvenience methods toBoxandVec#130061Vec::as_non_null()method libs-team#440Vec::as_non_null#130624Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩