[−][src]Struct cslice::CMutSlice
A mutable slice, equivalent to &'a mut T.
A CMutSlice can be constructed from a corresponding Rust slice via the AsCMutSlice trait.
A Rust slice can be constructed from a corresponding CMutSlice via as_mut.
Implementations
impl<'a, T> CMutSlice<'a, T>[src]
pub unsafe fn new(base: *mut T, len: usize) -> Self[src]
Create a CSlice from raw data.
Safety
The region of memory from base (inclusive) to base + len * sizeof<T>
(exclusive) must be valid for the duration of lifetime 'a.
pub fn as_ptr(&self) -> *const T[src]
Produces a raw pointer to the slice's buffer.
pub fn as_mut_ptr(&mut self) -> *mut T[src]
Produces a raw pointer to the slice's buffer.
pub fn as_slice(&self) -> &'a [T][src]
A cheap conversion to a Rust slice. This is slightly more general than as_ref.
pub fn as_mut_slice(&mut self) -> &'a mut [T][src]
A cheap conversion to a mutable Rust slice. This is slightly more general than as_mut.
pub fn len(&self) -> usize[src]
Returns the number of elements in the slice.
Trait Implementations
impl<'a, T> AsMut<[T]> for CMutSlice<'a, T>[src]
impl<'a, T> AsRef<[T]> for CMutSlice<'a, T>[src]
impl<'a, T: Clone> Clone for CMutSlice<'a, T>[src]
impl<'a, T: Copy> Copy for CMutSlice<'a, T>[src]
impl<'a, T> Index<usize> for CMutSlice<'a, T>[src]
impl<'a, T> IndexMut<usize> for CMutSlice<'a, T>[src]
impl<'a, T: Send> Send for CMutSlice<'a, T>[src]
impl<'a, T: Sync> Sync for CMutSlice<'a, T>[src]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for CMutSlice<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Unpin for CMutSlice<'a, T>
impl<'a, T> UnwindSafe for CMutSlice<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,