[][src]Crate safer_ffi

See the user guide.

Re-exports

pub use tuple::*;

Modules

boxed

#[repr(C)] Boxed types.

char_p

char *-compatible strings (slim pointers), for easier use from within C. They thus do not support inner nulls, nor string appending.

closure

Closures with a #[repr(C)] layout (inlined vtable), up to 9 function arguments.

layout

Trait abstractions describing the semantics of "being #[repr(C)]"

prelude
ptr

Wrappers around NonNull to better express the semantics of such pointer.

slice

Logic common to all fat pointers.

string

Rust string types with a defined #[repr(C)] layout, albeit not char * compatible (fat pointers).

tuple

Tuple types with a guaranteed #[repr(C)] layout.

vec

Macros

CType

Safely implement CType for a #[repr(C)] struct when all its fields are CType.

NULL
ReprC

Safely implement ReprC for a #[repr(C)] struct when all its fields are ReprC.

c_vec

Structs

String

Same as String, but with guaranteed #[repr(C)] layout

Vec

Same as Vec<T>, but with guaranteed #[repr(C)] layout

Attribute Macros

cfg_headers
ffi_export

Export a function to be callable by C.