Struct c_vec::CSlice [] [src]

pub struct CSlice<T> { /* fields omitted */ }

The type representing an 'unsafe' foreign chunk of memory

Methods

impl<T> CSlice<T>
[src]

Create a CSlice from a raw pointer to a buffer with a given length.

Panics if the given pointer is null. The returned vector will not attempt to deallocate the vector when dropped.

Arguments

  • base - A raw pointer to a buffer
  • len - The number of elements in the buffer

Retrieves an element at a given index, returning None if the requested index is greater than the length of the vector.

Retrieves a mutable element at a given index, returning None if the requested index is greater than the length of the vector.

Returns the number of items in this vector.

Returns whether this vector is empty.

Trait Implementations

impl<T> AsRef<[T]> for CSlice<T>
[src]

View the stored data as a slice.

impl<T> AsMut<[T]> for CSlice<T>
[src]

View the stored data as a slice.

impl<T> Index<usize> for CSlice<T>
[src]

The returned type after indexing

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

impl<T> IndexMut<usize> for CSlice<T>
[src]

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

impl<T: Clone> Into<Vec<T>> for CSlice<T>
[src]

Performs the conversion.