Expand description

The config module is used to change the behavior of bincode’s encoding and decoding logic.

Important make sure you use the same config for encoding and decoding, or else bincode will not work properly.

To use a config, first create a type of Configuration. This type will implement trait Config for use with bincode.

let config = bincode::config::standard()
    // pick one of:
    .with_big_endian()
    .with_little_endian()
    // pick one of:
    .with_variable_int_encoding()
    .with_fixed_int_encoding()
    // pick one of:
    .skip_fixed_array_length()
    .write_fixed_array_length();

See Configuration for more information on the configuration options.

Structs

Encodes all integer types in big endian.
The Configuration struct is used to build bincode configurations. The Config trait is implemented by this struct when a valid configuration has been constructed.
Use fixed-size integer encoding.
Sets the byte limit to N.
Encodes all integer types in little endian.
Sets an unlimited byte limit.
Skip writing the length of fixed size arrays ([u8; N]) before writing the array.
Use variable integer encoding.
Write the length of fixed size arrays ([u8; N]) before writing the array.

Traits

Indicates a type is valid for controlling the bincode configuration

Functions

Creates the “legacy” default config. This is the default config that was present in bincode 1.0
The default config for bincode 2.0. By default this will be: