Sorbit
Notice: the API is not yet stable.
Sorbit is a binary serialization framework that gives you complete control over the layout of the serialized data. Sorbit helps you define network packets, firmware messages, or other binary data structures that are governed by an external specification.
For further documentation, head to docs.rs.
Example
You can define the layout of data structure using attributes. This example shows the "inquiry" data format from the SCSI (hard drives, etc.) standard:
use ;
You can then convert the structure into bytes that can be sent to the recipient (in this case a SCSI hard drive):
use FixedMemoryStream;
use ;
let inquiry = default;
let mut buffer = ;
let stream = new; // no_std fixed size stream.
let mut serializer = new;
inquiry.serialize.unwrap;
License
Sorbit is distributed under the MIT license, like most Rust libraries. Feel free to use sorbit both commercially and non-commercially.