Struct ffi_convert::CArray [−][src]
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, Global>> for CArray<U>[src]
fn as_rust(&self) -> Result<Vec<V>, AsRustError>[src]
impl<T> CDrop for CArray<T>[src]
fn do_drop(&mut self) -> Result<(), CDropError>[src]
impl<U: CReprOf<V> + CDrop, V> CReprOf<Vec<V, Global>> for CArray<U>[src]
fn c_repr_of(input: Vec<V>) -> Result<Self, CReprOfError>[src]
impl<T: Debug> Debug for CArray<T>[src]
impl<T> Drop for CArray<T>[src]
impl<T> RawPointerConverter<CArray<T>> for CArray<T>[src]
fn into_raw_pointer(self) -> *const CArray<T>[src]
fn into_raw_pointer_mut(self) -> *mut CArray<T>[src]
unsafe fn from_raw_pointer(
input: *const CArray<T>
) -> Result<Self, UnexpectedNullPointerError>[src]
input: *const CArray<T>
) -> Result<Self, UnexpectedNullPointerError>
unsafe fn from_raw_pointer_mut(
input: *mut CArray<T>
) -> Result<Self, UnexpectedNullPointerError>[src]
input: *mut CArray<T>
) -> Result<Self, UnexpectedNullPointerError>
unsafe fn drop_raw_pointer(
input: *const T
) -> Result<(), UnexpectedNullPointerError>[src]
input: *const T
) -> Result<(), UnexpectedNullPointerError>
unsafe fn drop_raw_pointer_mut(
input: *mut T
) -> Result<(), UnexpectedNullPointerError>[src]
input: *mut T
) -> Result<(), UnexpectedNullPointerError>
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,
pub 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.
pub 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>,