pub struct RawSlice<T> { /* private fields */ }
Implementations§
Source§impl<T> RawSlice<T>
impl<T> RawSlice<T>
Sourcepub const unsafe fn new(data: &[T]) -> Self
pub const unsafe fn new(data: &[T]) -> Self
Creates a new RawSlice<T>
from a slice reference.
§Safety
- The caller must ensure that the slice outlives this
RawSlice<T>
. - The original slice must not be mutated while this
RawSlice<T>
is used.
Sourcepub const fn new_nulled() -> Self
pub const fn new_nulled() -> Self
Creates an empty RawSlice<T>
, equivalent to a null pointer with zero length.
Sourcepub const unsafe fn set(&mut self, data: &[T])
pub const unsafe fn set(&mut self, data: &[T])
Updates the raw pointer and length to point to a new slice.
§Safety
- The caller must ensure that the slice outlives this
RawSlice<T>
. - The original slice must not be mutated while this
RawSlice<T>
is used.
Sourcepub const fn set_null(&mut self)
pub const fn set_null(&mut self)
Set the internal data pointer to NULL and also clears the data length.
Trait Implementations§
impl<T: Copy> Copy for RawSlice<T>
impl<T: Eq> Eq for RawSlice<T>
impl<T: Send> Send for RawSlice<T>
Safety: This type MUST be used with mutex to ensure concurrent access is valid.
impl<T> StructuralPartialEq for RawSlice<T>
Auto Trait Implementations§
impl<T> Freeze for RawSlice<T>
impl<T> RefUnwindSafe for RawSlice<T>where
T: RefUnwindSafe,
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