Expand description
Functions to produce an OwningSlice<'_, T>, a.k.a. a
Vec<T, NoopAllocator<'_>>, from mutably borrowed MaybeUninit<T>s.
Note that there are no functions which take &mut ManuallyDrop here, even
as unsafe fns, since Vec may use it’s spare capacity in ways that
violate ManuallyDrop<T>’s validity invariants, not just it’s safety
invariants.
Functions§
- empty_
from_ maybeuninit - Create a
OwningSlice<'a, T>with a length of 0 and a capacity of 1 from a&'a mut MaybeUninit<T>>. - empty_
from_ maybeuninit_ slice - Create a
OwningSlice<'a, T>with a length of 0 from a&'a mut [MaybeUninit<T>]>. The capacity is the length of the given slice. - empty_
from_ ⚠raw - Create an empty
OwningSlice<'a, T>from a raw slice pointer. The capacity is the length of the given slice. - from_
maybeuninit ⚠ - Create a
OwningSlice<'a, T>with a length and capacity of 1 from a&'a mut MaybeUninit<T>>. - from_
maybeuninit_ ⚠slice - Create a
OwningSlice<'a, T>with a given length from a&'a mut [MaybeUninit<T>]>. The capacity is the length of the given slice. - from_
raw ⚠ - Create a
OwningSlice<'a, T>with a given length from a raw slice pointer. The capacity is the length of the given slice. - full_
from_ ⚠raw - Create a full
OwningSlice<'a, T>from a raw slice pointer. - new
- Create an empty
OwningSlice<'a, T>with a length and capacity of 0.
Type Aliases§
- Owning
Slice - An owning slice reference boorrowing a memory location but owning the value
in it, implemented as
Vec<T, NoopAllocator<'a>>.