Struct cslice::CSlice [] [src]

#[repr(C)]
pub struct CSlice<'a, T> { /* fields omitted */ }

An immutable slice, equivalent to &'a T.

A CSlice can be constructed from a corresponding Rust slice via the AsCSlice trait.

A Rust slice can be constructed from a corresponding CSlice via as_ref.

Methods

impl<'a, T> CSlice<'a, T>
[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.

Produces a raw pointer to the slice's buffer.

Returns the number of elements in the slice.

Trait Implementations

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

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

Performs the conversion.

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

impl<'a, T: Sync> Send for CSlice<'a, T>
[src]

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

The returned type after indexing

The method for the indexing (container[index]) operation