pub unsafe trait AsMutPtr: AsPtr {
// Required method
fn as_mut_ptr(&mut self) -> *mut Self::Type;
}Expand description
Obtain a mutable base pointer for a slice of data.
§Safety
The returned pointer must never be null! Furthermore, the mutable pointer must originally be derived from a mutable pointer.
Required Methods§
fn as_mut_ptr(&mut self) -> *mut Self::Type
Implementors§
impl<T> AsMutPtr for MutSlicePtr<'_, T>
Safety: SlicePtr may only contain non-null pointers. The only way to construct
a MutSlicePtr is from a mutable reference, so the underlying pointer is indeed
mutable.
impl<T, A> AsMutPtr for Poly<[T], A>where
A: AllocatorCore,
Safety: Slices never return a null pointer. A mutable reference to self signals
an exclusive borrow - so the underlying pointer is indeed mutable.