This repository provides Rust bindings for the Codex library, enabling seamless integration with Rust projects.
Include in your Cargo project:
[dependencies]
codex-bindings = "0.1.3"To learn how to use those bindings, take a look at the example project or the integration tests.
This crate automatically builds the required libcodex library during compilation, so you don't need to install nim-codex separately. However, you will need:
- Rust and Cargo
- Git
- Make
- C compiler
Building will automatically:
- Clone the nim-codex repository and it's submodules
- Build the Nim compiler from source
- Build libcodex with the Nim compiler
- Generate Rust bindings and compile the crate
Note: The first build may take 10-20 minutes as it needs to build the Nim compiler from source. Subsequent builds will be much faster.
cargo build --release
# or, for debug
cargo build# Run all tests
cargo test
# Run unit tests
cargo test-unit
# Run integration tests
cargo test-integration
# Run doctests
cargo test-docThis crate supports two linking modes via Cargo features:
cargo build
# or explicitly
cargo build --features dynamic-linkingcargo build --features static-linking[dependencies]
codex-bindings = { version = "0.1.3", features = ["static-linking"] }