Deku
Declarative binary reading and writing
This crate provides bit-level, symmetric, serialization/deserialization implementations for structs and enums
Why use Deku
Productivity: Deku will generate symmetric reader/writer functions for your type! Avoid the requirement of writing redundant, error-prone parsing and writing code for binary structs or network headers
Usage
[]
= "0.6"
no_std:
[]
= { = "0.6", = false, = ["alloc"] }
Example
See documentation or examples folder for more!
Simple example, let's read big-endian data into a struct, with fields containing different sizes, modify a value, and write it back
use *;
let data: = vec!;
let = from_bytes.unwrap;
assert_eq!;
val.field_c = 0xC0FE;
let data_out = val.to_bytes.unwrap;
assert_eq!;
Changelog
See CHANGELOG.md