[][src]Struct haru::vmbindings::carray::CArray

#[repr(C)]
pub struct CArray<T> { /* fields omitted */ }

A stable dynamic array interface that can be used with C

Methods

impl<T> CArray<T>[src]

pub unsafe fn new_nil() -> CArray<T>[src]

Creates a new array with data pointing to nil

pub fn new() -> CArray<T>[src]

Creates an empty CArray

pub fn deref(&mut self) -> CArray<T>[src]

Dereferences a CArray by creating a new CArray, and moving its data into the new array.

This is an internal function, you shouldn't really use this.

pub fn as_slice(&self) -> &[T][src]

Converts the array into an immutable slice.

pub fn as_mut_slice(&self) -> &mut [T][src]

Converts the array into an mutable slice.

pub fn as_bytes(&self) -> &[u8][src]

Converts the array into an immutable slice of raw bytes

pub fn as_mut_bytes(&mut self) -> &mut [u8][src]

Converts the array into a mutable slice of raw bytes

pub unsafe fn as_ptr(&self) -> *const T[src]

Retrieves the immutable data pointer

pub unsafe fn as_mut_ptr(&mut self) -> *mut T[src]

Retrieves the mutable data pointer

pub fn len(&self) -> usize[src]

Retrieves the length of the array

pub fn reserve(n: usize) -> CArray<T>[src]

Reserves a zero-initialised array

This is an internal function, you shouldn't really use this.

pub fn push(&mut self, val: T)[src]

Pushes a value onto the array, increasing its length by 1.

pub fn pop(&mut self)[src]

Pops a value from the array, decreasing its length by 1.

pub fn top(&self) -> &T[src]

Retrieves an immutable reference to the top value from the stack

pub fn top_mut(&mut self) -> &mut T[src]

Retrieves a mutable reference to the top value from the stack

Important traits for ArrayIter<'a, T>
pub fn iter(&self) -> ArrayIter<T>[src]

Gets the iterator for the array

pub fn insert(&mut self, pos: usize, elem: T)[src]

Inserts an element to an array at position pos

pub fn delete(&mut self, from_pos: usize, nelems: usize)[src]

Deletes nelems elements starting from position pos

Trait Implementations

impl GcTraceable for CArray<NativeValue>[src]

impl<T> Clone for CArray<T>[src]

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

Performs copy-assignment from source. Read more

impl<T> Drop for CArray<T>[src]

impl<T: Debug> Debug for CArray<T>[src]

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

type Output = T

The returned type after indexing.

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

Auto Trait Implementations

impl<T> !Send for CArray<T>

impl<T> !Sync for CArray<T>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]