Skip to main content

Module errors

Module errors 

Source
Expand description

§errors — Error taxonomy and FFI result type

Provides FfiErrorCode (C-ABI enum), FfiError (rich Rust error), FfiResult (C-ABI result wrapper), and the catch_panic utility that prevents panics from crossing the FFI boundary.

§Key principle

Panics must never cross the FFI boundary. Undefined behaviour results if a Rust panic unwinds into C or Go. Every extern "C" function in this crate wraps its body in catch_panic.

Structs§

FfiResult
C-ABI result type.

Enums§

FfiError
Rich Rust-side error type that can be converted to an FfiErrorCode + message.
FfiErrorCode
Numeric error codes that cross the FFI boundary.

Functions§

catch_panic
Run f and convert any Rust panic into an FfiResult error.
ffi_result_free
Free an FfiResult and all heap memory it owns.