Module encoding_rs::variant

source ·
Expand description

This module provides enums that wrap the various decoders and encoders. The purpose is to make Decoder and Encoder Sized by writing the dispatch explicitly for a finite set of specialized decoders and encoders. Unfortunately, this means the compiler doesn’t generate the dispatch code and it has to be written here instead.

The purpose of making Decoder and Encoder Sized is to allow stack allocation in Rust code, including the convenience methods on Encoding.