pgdog-plugin 0.1.1

pgDog plugin interface and helpers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::path::PathBuf;

fn main() {
    println!("cargo:rerun-if-changed=include/types.h");

    let bindings = bindgen::Builder::default()
        .header("include/wrapper.h")
        // Tell cargo to invalidate the built crate whenever any of the
        // included header files changed.
        .parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
        // Finish the builder and generate the bindings.
        .generate()
        // Unwrap the Result and panic on failure.
        .expect("Unable to generate bindings");

    let out_path = PathBuf::from("src");
    let _ = bindings.write_to_file(out_path.join("bindings.rs"));
}