Module pgx_pg_sys::submodules::ffi

source ·

Functions

Given a closure that is assumed to be a wrapped Postgres extern "C" function, pg_guard_ffi_boundary works with the Postgres and C runtimes to create a “barrier” that allows Rust to catch Postgres errors (elog(ERROR)) while running the supplied closure. This is done for the sake of allowing Rust to run destructors before Postgres destroys the memory contexts that Rust-in-Postgres code may be enmeshed in.