Bendy v0.2 has been released!
The bendy team at P3KI is proud to announce our latest release, coming with new high level error types, a better naming scheme, and substantial improvements to the decoding workflow.
It’s been a few months since our last release and we are proud to announce
that version 0.2
of the bendy serialization crate is now available on
crates.io for your pleasure.
Simplified Decoding
The original bendy release doesn’t include a predefined decoding trait and therefore no default implementations for any data structures defined by the standard library. This forced everyone who tried to use bendy for decoding to come up with their own definitions and introduced quite some boilerplate.
The main reason behind the decision to avoid such a trait in the beginning was our
rigid internal error handling and wanting to spare our users from having to squeeze
their custom error types into our corset. Based on the new exposed
high level error types and the related internal restructuring this is no longer
necessary and we are therefore glad to introduce the new FromBencode
decoding trait.
If you need to deserialize a data structure from bencode encoding, your single
point of contact with bendy should now be FromBencode
’s from_bencode
method.
This will enable you to deserialize all types implementing the trait without any
additional boilerplate code. It’ll also reduce the amount of work required for
adding support for custom types with multiple, nested structures.
Improved Naming
Properly naming things is hard.
We realized that the original name for the exposed encoding trait (Encodable
)
and methods were a bit to generic especially the method named to_bytes
ended up clashing with other serialization implementations. These generic names
also made it hard to read code combining multiple encodings
as the methods do not express what kind of encoding is actually used.
To avoid such ambiguity in the future the trait got renamed into ToBencode
and the method is now called to_bencode
which should improve the readability
of all code using bendy and reduce the required cognitive load in
cases a mix of multiple different encodings are required for serialization.
Documentation
All documentation has been updated to reflect the recent changes. While doing this we’ve also added more useful examples to help you with integrating bendy into your projects.
Changelog & Examples
Please check out the changelog and the updated docs to get details on all changes: