binrw
A Rust crate for helping read structs from binary data using ✨macro magic✨
0.15.2
12M downloads/mo
#2791 most downloaded on crates.io
jam1garner/binrw
What this package is like to depend on
Last release 1 months ago
23 Jul 2026
Ships fairly regularly
a new release about every 4 months
Rarely documented
notes for 6 of 34 stable releases
1 version withdrawn
withdrawn after publishing
6 years old
36 releases · first in 2020
6 releases in the last 12 months
see the full history below
Release timeline
36 releases · Sep 2020 to Jul 2026Releases
latest 36-
0.15.223 Jul 2026Release notes
Open source →Bug fixes
- binrw is now future-compatible with pub_use_of_private_extern_crate. (#361. Thanks, @jakobhellermann!)
-
0.15.104 Mar 2026Release notes
Open source →Changes
- The rarely-used variadic signature for
#[binrw::parser]and#[binrw::writer]helper functions now requires a field name (i.e.fn foo(...)must now befn foo(_: ...)so that the Rust compiler team can do good things. (#342)
- The rarely-used variadic signature for
-
0.15.005 May 2025Release notes
Open source →Breaking changes
- The generic parameter lists for
binrw::helpersfunctions have been reordered to put most-frequently-used parameters first. - Lifetime parameters have been added to several
binrw::helpersfunctions to support borrowed arguments. - The MSRV has been increased to 1.70.
- Parsing a unit enum with
magicwill now return anIo(UnexpectedEof)error when all attempts to read magic result in anUnexpectedEof. Previously, this would returnNoVariantMatch. (#324, #325. Thanks, @plaflamme!)
Enhancements
PosValuenow includes implementations forDefaultandBinWrite. TheBinWriteimplementation simply treatsPosValueas a wrapper and writes the stored value in place; theposfield is ignored. Use theseek_beforeand (optionally)restore_positiondirectives if you want to write aPosValuevalue to a different position in the output stream. (#270, #273. Thanks, @amirbou!)- binrw now uses syn 2 internally, which should reduce the build time for most users of binrw when used with other dependencies that have also updated to syn 2. (#285, #299. Thanks, @Urist-McGit!)
- The amount of code generated has been reduced, improving compilation times. (#319. Thanks, @ScanMountGoat!)
- Various small documentation improvements. (Thanks, @marxin!)
BinWrite::write_neandBinWrite::write_ne_argsconvenience functions have been added to match the same functions in theBinReadAPI.- The owo-colors dependency has been updated to version 4.
Bug fixes
- Using
SeekFrom::EndwithTakeSeeknow correctly seeks relative to the end of the stream if the stream is shorter than the limit. (#291) - Using
binrw::helpers::count_withto return aVec<{integer}>using a custom function will no longer ignore the custom function. (#318. Thanks, @kitlith!) - It is now possible to pass borrowed values when using
binrw::helpersfunctions. - The
argsdirective can now be used when closures are passed toparse_withorwrite_with. - All forwarding calls in the
BinReadExtandBinWriteExttraits are now appropriately annotated with#[inline].
- The generic parameter lists for
-
0.14.204 Mar 2026Nothing published for this version
-
0.14.113 Oct 2024Release notes
Open source →Bug fixes
- Passing a
SeekFrom::EndtoTakeSeek::seeknow correctly seeks from the end of theTakeSeekstream instead of the end of the inner stream. (#291)
- Passing a
-
0.14.007 Jun 2024Release notes
Open source →Breaking changes
- In derived
BinWriteimplementations, imported variables are now exposed before field variables, to match the way lexical scoping normally works. If an import and a field have the same name, this will cause the import to be shadowed. Previously, the field would be shadowed.
Enhancements
- Diagnostic output is improved when using
parse_withandmaptogether in an incompatible way.
Bug fixes
- It is now possible to use a mix of generic and concrete types in
BinWritederives without triggering a type mismatch error. - It is now possible to use the anonymous lifetime
'_within nested types inside animportdirective. (#241) - The compiler will no longer panic when
verbose-backtraceis enabled and a derived type contains a docblock with a completely empty line. (#263) - Generated code will no longer trigger
clippy::unnecessary_fallible_conversionslints.
- In derived
-
0.13.404 Mar 2026Nothing published for this version
-
0.13.329 Nov 2023Release notes
Open source →Bug fixes
- Using
parse_with/write_with,map_stream, andargstogether will no longer raise an error about incompatible stream types. (#240)
- Using
-
0.13.226 Nov 2023Nothing published for this version
-
0.13.105 Nov 2023Nothing published for this version
-
0.13.027 Oct 2023Nothing published for this version
-
0.12.104 Mar 2026Nothing published for this version
-
0.12.021 Sep 2023Nothing published for this version
-
0.11.304 Mar 2026Nothing published for this version
-
0.11.215 May 2023Nothing published for this version
-
0.11.105 Feb 2023Nothing published for this version
-
0.11.005 Feb 2023Nothing published for this version
-
0.10.017 Sep 2022Nothing published for this version
-
0.10.0-rc.030 Aug 2022 pre-releaseNothing published for this version
-
0.9.201 Jul 2022Nothing published for this version
-
0.9.124 Jun 2022Nothing published for this version
-
0.9.024 Jun 2022Nothing published for this version
-
0.8.409 Jan 2022Nothing published for this version
-
0.8.309 Jan 2022Nothing published for this version
-
0.8.209 Jan 2022Nothing published for this version
-
0.8.030 Sep 2021Nothing published for this version
-
0.7.028 Sep 2021Nothing published for this version
-
0.6.025 Aug 2021Nothing published for this version
-
0.5.122 Aug 2021Nothing published for this version
-
0.5.009 Aug 2021Nothing published for this version
-
0.4.002 Jun 2021Nothing published for this version
-
0.3.128 Mar 2021Nothing published for this version
-
0.3.028 Mar 2021 withdrawnNothing published for this version
-
0.2.124 Mar 2021Nothing published for this version
-
0.2.024 Mar 2021Nothing published for this version
-
0.1.012 Sep 2020Nothing published for this version