Expand description
A crate to help make working with FFI easier.
Re-exports§
pub use crate::error_handling::error_message;
pub use crate::error_handling::take_last_error;
pub use crate::error_handling::update_last_error;
pub use crate::panic::catch_panic;
pub use crate::task::Task;
Modules§
- error_
handling - Common error handling routines.
- panic
- task
- Management of asynchronous tasks in an FFI context.
Macros§
- catch_
panic - A convenience macro for running a fallible operation (which may panic) and
returning
Nullable::NULL
if there are any errors. - export_
error_ handling_ functions - As a workaround for rust-lang/rfcs#2771, you can use this macro to
make sure the symbols for
ffi_helpers
’s error handling are correctly exported in yourcdylib
. - export_
task - Convenience macro to define the FFI bindings for working with a
Task
. - null_
pointer_ check - Check if we’ve been given a null pointer, if so we’ll return early.
Structs§
- Null
Pointer - A
null
pointer was encountered where it wasn’t expected.
Traits§
- Nullable
- An object which has an “obviously invalid” value, for use with the
null_pointer_check!()
macro. - Split
- A helper trait used by
split_closure()
to get a trampoline function which will invoke the closure.
Functions§
- split_
closure ⚠ - Splits a closure into its data part and its code part, allowing it to be used as a callback by FFI code.