[−][src]Struct ffi_convert::CArray
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,
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,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,