[][src]Struct ffi_convert::CArray

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

A utility type to represent arrays of the parametrized type. Note that the parametrized type should have a C-compatible representation.

Example

use ffi_convert::{CReprOf, AsRust, CDrop, CArray};
use libc::c_char;

pub struct PizzaTopping {
    pub ingredient: String,
}

#[derive(CDrop, CReprOf, AsRust)]
#[target_type(PizzaTopping)]
pub struct CPizzaTopping {
    pub ingredient: *const c_char
}

let toppings = vec![
        PizzaTopping { ingredient: "Cheese".to_string() },
        PizzaTopping { ingredient: "Ham".to_string() } ];

let ctoppings = CArray::<CPizzaTopping>::c_repr_of(toppings);

Trait Implementations

impl<U: AsRust<V>, V> AsRust<Vec<V>> for CArray<U>[src]

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

impl<U: CReprOf<V> + CDrop, V> CReprOf<Vec<V>> for CArray<U>[src]

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

Auto Trait Implementations

impl<T> RefUnwindSafe for CArray<T> where
    T: RefUnwindSafe

impl<T> !Send for CArray<T>

impl<T> !Sync for CArray<T>

impl<T> Unpin for CArray<T>

impl<T> UnwindSafe for CArray<T> where
    T: RefUnwindSafe

Blanket Implementations

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

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

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

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

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.