Skip to main content

Crate ffi_convert_extra_ctypes

Crate ffi_convert_extra_ctypes 

Source
Expand description

C-compatible mirrors of a few standard Rust containers, for use with ffi-convert.

The three types exposed here cover the containers most FFI boundaries inevitably need:

Rust typeC-compatible mirror
Vec<T>CArray<T>
Vec<String>CStringArray
std::ops::Range<T>CRange<T>

Each mirror implements CReprOf, AsRust, and CDrop, so it can be embedded in any struct you derive the conversion traits on — see the top-level ffi-convert documentation for how the pieces fit together.

This crate is optional: if none of these types fit your layout, depend on ffi-convert alone and define your own #[repr(C)] container with the conversion trait impls you need.

Structs§

CArray
A #[repr(C)] mirror of Vec<U> with impls of CReprOf, CDrop and AsRust.
CRange
A #[repr(C)] mirror of std::ops::Range<U> with impls of CReprOf, CDrop and AsRust.
CStringArray
A #[repr(C)] mirror of Vec<String> with impls of CReprOf, CDrop and AsRust.