xref: /aosp_15_r20/external/vboot_reference/rust/README.md (revision 8617a60d3594060b7ecbd21bc622a7c14f3cf2bc)
1*8617a60dSAndroid Build Coastguard Worker# Rust bindings for vboot_reference
2*8617a60dSAndroid Build Coastguard Worker
3*8617a60dSAndroid Build Coastguard WorkerThis path contains the vboot_reference-sys crate which uses bindgen to generate
4*8617a60dSAndroid Build Coastguard WorkerRust bindings for the vboot_reference C library.
5*8617a60dSAndroid Build Coastguard Worker
6*8617a60dSAndroid Build Coastguard WorkerEach header is included as its own submodule. To use these bindings:
7*8617a60dSAndroid Build Coastguard Worker * Add `vboot_reference-sys` to your `Cargo.toml` for example:
8*8617a60dSAndroid Build Coastguard Worker```toml
9*8617a60dSAndroid Build Coastguard Worker[dependencies]
10*8617a60dSAndroid Build Coastguard Workervboot_reference-sys = { path = "../../vboot_reference/rust/vboot_reference-sys" }
11*8617a60dSAndroid Build Coastguard Worker```
12*8617a60dSAndroid Build Coastguard Worker * Include the symbols you need for example:
13*8617a60dSAndroid Build Coastguard Worker```rust
14*8617a60dSAndroid Build Coastguard Workeruse vboot_reference_sys::crossystem::*;
15*8617a60dSAndroid Build Coastguard Worker```
16*8617a60dSAndroid Build Coastguard Worker
17*8617a60dSAndroid Build Coastguard WorkerThe `build.rs` in `vboot_reference-sys` takes care of adding the necessary
18*8617a60dSAndroid Build Coastguard Workerincludes and linker flags for `vboot_host` through the `pkg-config` crate.
19