feat(hyperhdr): vendor the flatbuffers schemas and generated bindings

The .fbs files come from HyperHDR (see schema/NOTICE); the *_generated.rs
files are flatc output regenerated by scripts/regen-fbs.sh, which refuses to
run unless flatc matches the pinned flatbuffers crate.
This commit is contained in:
2026-09-12 10:08:56 +03:00
parent 623fab55e5
commit 617296afae
9 changed files with 1911 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Regenerate Rust code from the HyperHDR flatbuffers schemas.
# The flatc version must match the `flatbuffers` crate version in Cargo.toml.
set -euo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
out="$root/src/hyperhdr/generated"
crate_ver="$(grep -E '^flatbuffers\s*=' "$root/Cargo.toml" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')"
flatc_ver="$(flatc --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')"
if [[ "$crate_ver" != "$flatc_ver" ]]; then
echo "flatc $flatc_ver does not match flatbuffers crate $crate_ver" >&2
exit 1
fi
rm -f "$out"/*_generated.rs
mkdir -p "$out"
flatc --rust -o "$out" "$root/schema/hyperhdr_request.fbs" "$root/schema/hyperhdr_reply.fbs"
echo "generated with flatc $flatc_ver:"
ls -1 "$out"