| Crates.io | foxglove-flatbuffers |
| lib.rs | foxglove-flatbuffers |
| version | 0.3.7 |
| created_at | 2026-01-24 10:28:05.219879+00 |
| updated_at | 2026-01-24 15:20:21.897645+00 |
| description | Rust bindings for Foxglove FlatBuffer message schemas |
| homepage | |
| repository | https://github.com/johnhalz/foxglove-flatbuffers |
| max_upload_size | |
| id | 2066510 |
| size | 635,285 |
Rust bindings for Foxglove FlatBuffer message schemas.
This crate provides type-safe Rust bindings for all Foxglove FlatBuffer message types, generated from the official Foxglove schemas.
flatbuffersno_std SupportThis crate supports no_std environments with alloc when using pre-generated code!
The pre-generated feature is enabled by default. For no_std support, enable the no_std feature:
[dependencies]
foxglove-flatbuffers = { version = "0.1", features = ["no_std"] }
Limitations:
no_std + alloc environmentsalloc (heap allocation) - pure no_std without alloc is not supportedFlatBufferBuilder) may have limitations in no_std environmentsflatbuffers builder APIs may require std featuresPre-generated Code:
The code is already pre-generated and included in the repository. This means:
flatc compiler needed for normal usageno_std environments with allocIf you're a maintainer and need to regenerate the code (e.g., after schema updates):
./scripts/download_schemas.sh # Download latest schemas
./scripts/generate_and_commit.sh # Regenerate and commit code
Add this to your Cargo.toml:
[dependencies]
foxglove-flatbuffers = "0.1"
flatbuffers = "24.3"
Note: By default, this crate uses pre-generated code, so you don't need the FlatBuffers compiler (flatc) installed. The code is already included in the repository.
No prerequisites required by default! The crate uses pre-generated code that's included in the repository.
If you want to generate code at build time instead (by disabling the default pre-generated feature), you'll need the FlatBuffers compiler (flatc):
brew install flatbuffers
sudo apt-get install flatbuffers-compiler
Download from: https://github.com/google/flatbuffers/releases
use foxglove_flatbuffers::*;
use flatbuffers::GetRoot;
// Your FlatBuffer bytes
let data: &[u8] = /* ... */;
// Read a Time message (example)
// Note: Actual API depends on generated code structure
// let time = Time::get_root_as_root(data);
use foxglove_flatbuffers::*;
use flatbuffers::{FlatBufferBuilder, WIPOffset};
// Create a builder
let mut builder = FlatBufferBuilder::new();
// Build your message using the generated types
// (Example - actual API depends on generated code)
// let time_offset = Time::create(&mut builder, &time_args);
// Finish the buffer
// builder.finish(time_offset, None);
// let finished_data = builder.finished_data();
flatc needed - uses pre-generated code):
cargo build
For maintainers: If you need to regenerate the code:
flatc (see Prerequisites above)./scripts/download_schemas.sh
./scripts/generate_and_commit.sh
foxglove-flatbuffers/
├── Cargo.toml # Crate configuration
├── build.rs # Build script for code generation (when pre-generated disabled)
├── schemas/ # FlatBuffer schema files (.fbs) - optional, for regeneration
├── scripts/
│ ├── download_schemas.sh # Script to download schemas
│ └── generate_and_commit.sh # Script to regenerate code
└── src/
├── lib.rs # Library entry point
└── generated/ # Pre-generated Rust code (included in repo)
└── foxglove/ # Generated message types
This crate supports all Foxglove FlatBuffer message types, including:
Time, DurationPose, PoseInFrame, PosesInFramePoint2, Point3, Vector2, Vector3QuaternionSceneUpdate, SceneEntityPointCloud, LaserScanCompressedImage, RawImageCameraCalibrationLocationFix, GeoJSONSee the Foxglove schemas repository for the complete list.
This project is licensed under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.