Struct cslice::CMutSlice [] [src]

pub struct CMutSlice<'a, T> {
    // some fields omitted
}

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.

Methods

impl<'a, T> CMutSlice<'a, T>
[src]

unsafe fn new(base: *mut T, len: usize) -> Self

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.

fn as_ptr(&self) -> *const T

Produces a raw pointer to the slice's buffer.

fn as_mut_ptr(&mut self) -> *mut T

Produces a raw pointer to the slice's buffer.

fn len(&self) -> usize

Returns the number of elements in the slice.

Trait Implementations

impl<'a, T: Copy> Copy for CMutSlice<'a, T>
[src]

impl<'a, T: Clone> Clone for CMutSlice<'a, T>
[src]

fn clone(&self) -> CMutSlice<'a, T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<'a, T> AsRef<[T]> for CMutSlice<'a, T>
[src]

fn as_ref(&self) -> &[T]

Performs the conversion.

impl<'a, T> AsMut<[T]> for CMutSlice<'a, T>
[src]

fn as_mut(&mut self) -> &mut [T]

Performs the conversion.

impl<'a, T> Sync for CMutSlice<'a, T>
[src]

impl<'a, T> Index<usize> for CMutSlice<'a, T>
[src]

type Output = T

The returned type after indexing

fn index(&self, i: usize) -> &T

The method for the indexing (Foo[Bar]) operation

impl<'a, T> IndexMut<usize> for CMutSlice<'a, T>
[src]

fn index_mut(&mut self, i: usize) -> &mut T

The method for the indexing (Foo[Bar]) operation