Registry / serialization / binread

binread

JSON →
library2.2.0rscratesunverified

A Rust crate for reading structs from binary data using derive macros, simplifying binary parsing.

# Cargo.toml [dependencies] binread = "2.2.0"
INSTALL
IMPORT
SIG · BINREAD
B
binread
serializationrustv2.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BinRead
use binread::BinRead;

Define a binary struct and read it from bytes.

use binread::BinRead; #[derive(BinRead)] #[br(little)] struct Header { magic: [u8; 4], size: u32, } let data = b"\x00\x01\x02\x03\x04\x00\x00\x00"; let header = Header::read(&mut std::io::Cursor::new(data)).unwrap();
Debug
Known issues
gotchaRequires `binread_derive` feature for derive macros
fix
Add `binread = { version = "2", features = ["binread_derive"] }`
affects: >=2.0.0
Upgrade
Version history
2.2.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
binread — cargo add binread · libregistry