#[repr(C)]pub struct RawSliceMut<T> { /* private fields */ }Expand description
A C complitable mutable slice of type T
Implementations§
Source§impl<T> RawSliceMut<T>
impl<T> RawSliceMut<T>
pub unsafe fn from_raw_parts(ptr: *mut T, len: usize) -> RawSliceMut<T>
pub fn len(&self) -> usize
pub fn as_ptr(&self) -> *const T
pub fn as_mut_ptr(&self) -> *mut T
Sourcepub unsafe fn into_slice_mut<'a>(self) -> Option<&'a mut [T]>
pub unsafe fn into_slice_mut<'a>(self) -> Option<&'a mut [T]>
Converts a RawSliceMut<T> into a slice of type T
returns None if the slice ptr is null or the length is zero
§Safety
panics if the slice ptr is not aligned to the alignment of T
Source§impl<T> RawSliceMut<RawSlice<T>>
impl<T> RawSliceMut<RawSlice<T>>
Sourcepub unsafe fn from_slices(slices: *mut [&[T]]) -> RawSliceMut<RawSlice<T>>
pub unsafe fn from_slices(slices: *mut [&[T]]) -> RawSliceMut<RawSlice<T>>
Converts a slice of slices of [T] into RawSliceMut<RawSlice<T>>
§Safety
slices becomes invalid after use
as it is going to be reused as a memory location for creating Self
making this unexpensive but dangerous
O(N) expect if the Layout of RawSlice is equal to the Layout of rust slices, and it has been optimized it is O(1)
Trait Implementations§
Source§impl<T> Clone for RawSliceMut<T>where
T: Clone,
impl<T> Clone for RawSliceMut<T>where
T: Clone,
Source§fn clone(&self) -> RawSliceMut<T>
fn clone(&self) -> RawSliceMut<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for RawSliceMut<T>where
T: Debug,
impl<T> Debug for RawSliceMut<T>where
T: Debug,
impl<T> Copy for RawSliceMut<T>where
T: Copy,
Auto Trait Implementations§
impl<T> Freeze for RawSliceMut<T>
impl<T> RefUnwindSafe for RawSliceMut<T>where
T: RefUnwindSafe,
impl<T> !Send for RawSliceMut<T>
impl<T> !Sync for RawSliceMut<T>
impl<T> Unpin for RawSliceMut<T>
impl<T> UnwindSafe for RawSliceMut<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more