#[repr(C)]pub struct RawSlice<T> { /* private fields */ }Expand description
A C compatible slice of type T
Implementations§
Source§impl<T> RawSlice<T>
impl<T> RawSlice<T>
pub unsafe fn from_raw_parts(ptr: *const T, len: usize) -> RawSlice<T>
pub unsafe fn from_slice(slice: &[T]) -> RawSlice<T>
pub fn len(&self) -> usize
pub fn as_ptr(&self) -> *const T
Sourcepub unsafe fn into_slice<'a>(self) -> Option<&'a [T]>
pub unsafe fn into_slice<'a>(self) -> Option<&'a [T]>
Converts a RawSlice<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
Trait Implementations§
impl<T> Copy for RawSlice<T>where
T: Copy,
Auto Trait Implementations§
impl<T> Freeze for RawSlice<T>
impl<T> RefUnwindSafe for RawSlice<T>where
T: RefUnwindSafe,
impl<T> !Send for RawSlice<T>
impl<T> !Sync for RawSlice<T>
impl<T> Unpin for RawSlice<T>
impl<T> UnwindSafe for RawSlice<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