Module libffi::middle [] [src]

Middle layer providing a somewhat safer (but still quite unsafe) API.

The main idea of the middle layer is to wrap types ffi_cif and ffi_closure as Cif and Closure, respectively, so that their resources are managed properly. However, calling a function via a CIF or closure is still unsafe because argument types aren’t checked. See the high layer for closures with type-checked arguments.

Reexports

pub use low::Callback;
pub use low::CallbackMut;
pub use low::CodePtr;

Structs

Arg

Contains an untyped pointer to a function argument.

Builder

Provides a builder-style API for constructing CIFs and closures.

Cif

Describes the calling convention and types for calling a function.

Closure

Represents a closure callable from C.

ClosureOnce

A closure that owns needs-drop data.

Type

Represents a single C type.

Enums

FfiAbi

Constants

ffi_abi_FFI_DEFAULT_ABI

Functions

arg

Coerces an argument reference into the Arg type.

Type Definitions

CallbackOnce

The type of callback invoked by a ClosureOnce.