Expand description
A low-level wrapping of libffi, this layer makes no attempts at safety, but tries to provide a somewhat more idiomatic interface.
This module also re-exports types and constants necessary for using the
library, so it should not be generally necessary to use the raw module.
While this is a bit “Rustier” than raw, I’ve
avoided drastic renaming in favor of hewing close to the libffi API.
See middle for an easier-to-use approach.
Modules§
- type_
tag - Type tags used in constructing and inspecting
ffi_types. - types
- Re-exports the
ffi_typeobjects used to describe the types of arguments and results.
Structs§
- CodePtr
- Wraps a function pointer of unknown type.
- ffi_cif
- A struct used by
libffito describe a function’s ABI and type signature. - ffi_
closure - A struct used by
libffito describe and manage closures. - ffi_
type - A struct used by
libffito describe types and their memory layout.
Enums§
- Error
- The two kinds of errors reported by libffi.
Constants§
Functions§
- call⚠
- Calls a C function as specified by a CIF.
- closure_
alloc - Allocates a closure.
- closure_
free ⚠ - Frees a closure.
- prep_
cif ⚠ - Initalizes a CIF (Call Interface) with the given ABI and types.
- prep_
cif_ ⚠var - Initalizes a CIF (Call Interface) for a varargs function.
- prep_
closure ⚠ - Initializes a closure with a callback function and userdata.
- prep_
closure_ ⚠mut - Initializes a mutable closure with a callback function and (mutable) userdata.
Type Aliases§
- Callback
- The type of function called by a closure.
- Callback
Mut - The type of function called by a mutable closure.
- RawCallback
- The callback type expected by
raw::ffi_prep_closure_loc. - Result
- The
std::result::Resulttype specialized for libffiErrors. - ffi_abi
- The type used to convey the ABI of a function.
- ffi_arg
- The smallest unsigned integer type returned by
ffi_call. - ffi_
sarg - The smallest signed integer type returned by
ffi_call. - ffi_
status - The return type of
libffi’s functions that may return an error.