#[repr(C)]pub struct CStringArray {
pub data: *const *const c_char,
pub size: usize,
}Expand description
A utility type to represent arrays of string
§Example
use ffi_convert::{CReprOf, CStringArray};
let pizza_names = vec!["Diavola".to_string(), "Margarita".to_string(), "Regina".to_string()];
let c_pizza_names = CStringArray::c_repr_of(pizza_names).expect("could not convert !");
Fields§
§data: *const *const c_charPointer to the first element of the array
size: usizeNumber of elements in the array
Trait Implementations§
Source§impl CDrop for CStringArray
impl CDrop for CStringArray
Source§impl Debug for CStringArray
impl Debug for CStringArray
Source§impl Drop for CStringArray
impl Drop for CStringArray
Source§impl RawPointerConverter<CStringArray> for CStringArray
impl RawPointerConverter<CStringArray> for CStringArray
Source§fn into_raw_pointer(self) -> *const CStringArray
fn into_raw_pointer(self) -> *const CStringArray
Creates a raw pointer from the value and leaks it, you should use
Self::from_raw_pointer
or Self::drop_raw_pointer to free the value when you’re done with it.Source§fn into_raw_pointer_mut(self) -> *mut CStringArray
fn into_raw_pointer_mut(self) -> *mut CStringArray
Creates a mutable raw pointer from the value and leaks it, you should use
Self::from_raw_pointer_mut or Self::drop_raw_pointer_mut to free the value when
you’re done with it.Source§unsafe fn from_raw_pointer_mut(
input: *mut CStringArray,
) -> Result<CStringArray, UnexpectedNullPointerError>
unsafe fn from_raw_pointer_mut( input: *mut CStringArray, ) -> Result<CStringArray, UnexpectedNullPointerError>
Takes back control of a raw pointer created by
Self::into_raw_pointer_mut. Read moreSource§unsafe fn from_raw_pointer(
input: *const CStringArray,
) -> Result<CStringArray, UnexpectedNullPointerError>
unsafe fn from_raw_pointer( input: *const CStringArray, ) -> Result<CStringArray, UnexpectedNullPointerError>
Takes back control of a raw pointer created by
Self::into_raw_pointer. Read moreSource§unsafe fn drop_raw_pointer(
input: *const T,
) -> Result<(), UnexpectedNullPointerError>
unsafe fn drop_raw_pointer( input: *const T, ) -> Result<(), UnexpectedNullPointerError>
Takes back control of a raw pointer created by
Self::into_raw_pointer and drop it. Read moreSource§unsafe fn drop_raw_pointer_mut(
input: *mut T,
) -> Result<(), UnexpectedNullPointerError>
unsafe fn drop_raw_pointer_mut( input: *mut T, ) -> Result<(), UnexpectedNullPointerError>
Takes back control of a raw pointer created by
Self::into_raw_pointer_mut and drops it. Read moreimpl Sync for CStringArray
Auto Trait Implementations§
impl Freeze for CStringArray
impl RefUnwindSafe for CStringArray
impl !Send for CStringArray
impl Unpin for CStringArray
impl UnwindSafe for CStringArray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> RawBorrow<T> for T
impl<T> RawBorrow<T> for T
Source§unsafe fn raw_borrow<'a>(
input: *const T,
) -> Result<&'a T, UnexpectedNullPointerError>
unsafe fn raw_borrow<'a>( input: *const T, ) -> Result<&'a T, UnexpectedNullPointerError>
Get a reference on the value behind the pointer or return an error if the pointer is
null. Read moreSource§impl<T> RawBorrowMut<T> for T
impl<T> RawBorrowMut<T> for T
Source§unsafe fn raw_borrow_mut<'a>(
input: *mut T,
) -> Result<&'a mut T, UnexpectedNullPointerError>
unsafe fn raw_borrow_mut<'a>( input: *mut T, ) -> Result<&'a mut T, UnexpectedNullPointerError>
Get a mutable reference on the value behind the pointer or return an error if the pointer is
null. Read more