| Crates.io | xgrammar |
| lib.rs | xgrammar |
| version | 0.3.0 |
| created_at | 2025-10-10 15:41:32.387305+00 |
| updated_at | 2026-01-09 22:32:06.389067+00 |
| description | Rust bindings for XGrammar |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1877104 |
| size | 8,050,179 |
This project uses xgrammar v0.1.29 as a submodule.
This project provides safe and idiomatic Rust bindings for the xgrammar C++ library.
By wrapping the C++ implementation, this crate leverages Rust's memory safety
andguarantees while providing access to xgrammar's high-performance and features
for constraint decoding.
Before building the project, ensure you have the following dependencies installed:
xgrammar library.The C++ xgrammar library is included as a submodule and will be compiled automatically as part of the build process.
To build the project, run the following command:
cargo build --release
This will create a release build in the target/release directory.
This project uses cargo-nextest for running tests. To execute all tests, run:
make test
You can also pass arguments to cargo nextest via the TEST_ARGS variable. For example, to run a specific test suite:
make test TEST_ARGS="--test test_grammar"