| Crates.io | signet-mdbx-sys |
| lib.rs | signet-mdbx-sys |
| version | 0.1.0 |
| created_at | 2026-01-23 21:10:13.566424+00 |
| updated_at | 2026-01-25 23:20:03.442469+00 |
| description | Raw bindings for libmdbx |
| homepage | https://github.com/init4tech/signet-mdbx |
| repository | https://github.com/init4tech/signet-mdbx |
| max_upload_size | |
| id | 2065477 |
| size | 3,467,587 |
Raw FFI bindings for libmdbx.
Platform-specific bindings are pre-generated and committed:
src/bindings_macos.rs - macOS and other Unix-like systemssrc/bindings_linux.rs - Linuxsrc/bindings_windows.rs - WindowsWhen updating libmdbx, regenerate bindings on each target platform.
Generate bindings:
# First build the Docker image
docker build -t mdbx-bindgen -f Dockerfile.bindgen .
# Then run bindgen inside the container
docker run --rm -v "$(pwd)":/work mdbx-bindgen \
libmdbx/mdbx.h \
--allowlist-var "^(MDBX|mdbx)_.*" \
--allowlist-type "^(MDBX|mdbx)_.*" \
--allowlist-function "^(MDBX|mdbx)_.*" \
--no-layout-tests \
--no-doc-comments \
--no-prepend-enum-name \
--merge-extern-blocks \
-o src/bindings_linux.rs
Install bindgen-cli and run directly:
# Install bindgen-cli if not already installed
cargo install bindgen-cli
# Generate bindings for your platform
bindgen libmdbx/mdbx.h \
--allowlist-var "^(MDBX|mdbx)_.*" \
--allowlist-type "^(MDBX|mdbx)_.*" \
--allowlist-function "^(MDBX|mdbx)_.*" \
--no-layout-tests \
--no-doc-comments \
--no-prepend-enum-name \
--merge-extern-blocks \
-o src/bindings_macos.rs
# or src/bindings_windows.rs
# or src/bindings_linux.rs
Requires libclang. On macOS:
brew install llvm
export LIBCLANG_PATH=$(brew --prefix llvm)/lib