mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-13 00:12:54 +00:00
Create Rust bindings for C functions from walproposer. This allows to write better tests with real walproposer code without spawning multiple processes and starting up the whole environment. `make walproposer-lib` stage was added to build static libraries `libwalproposer.a`, `libpgport.a`, `libpgcommon.a`. These libraries can be statically linked to any executable to call walproposer functions. `libs/walproposer/src/walproposer.rs` contains `test_simple_sync_safekeepers` to test that walproposer can be called from Rust to emulate sync_safekeepers logic. It can also be used as a usage example.
15 lines
460 B
Rust
15 lines
460 B
Rust
pub mod bindings {
|
|
#![allow(non_upper_case_globals)]
|
|
#![allow(non_camel_case_types)]
|
|
#![allow(non_snake_case)]
|
|
// bindgen creates some unsafe code with no doc comments.
|
|
#![allow(clippy::missing_safety_doc)]
|
|
// noted at 1.63 that in many cases there's a u32 -> u32 transmutes in bindgen code.
|
|
#![allow(clippy::useless_transmute)]
|
|
|
|
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
|
}
|
|
|
|
pub mod api_bindings;
|
|
pub mod walproposer;
|