Encode, a Rust library for building encoders and serializers
Encoders/serializers made easy.
encode is a toolbox for building encoders and serializers in Rust. It is
heavily inspired by the winnow and
nom crates, which are used for building
parsers. It is meant to be a companion to these crates, providing a similar
level of flexibility and ease of use for reversing the parsing process.
The main idea behind encode is to provide a set of combinators for building
serializers. These combinators can be used to build complex encoders from simple
building blocks. This makes it easy to build encoders for different types of
data, without having to write a lot of boilerplate code.
Another key feature of encode is its support for no_std environments. This
makes it suitable for use in embedded systems, where the standard library (and
particularly the [std::io] module) is not available.
See the examples folder for some examples of how to use encode. Also, check
the [combinators] module for a list of all the combinators provided by the
crate.
Feature highlights
#![no_std]compatible#![forbid(unsafe_code)]- Simple and flexible API
- Minimal dependencies
- Ready to use combinators for minimizing boilerplate.
Cargo features
default: Enables thestdfeature.std: Enables the use of the standard library.alloc: Enables the use of thealloccrate.arrayvec: Implements [Encodable] for [arrayvec::ArrayVec].