Module config

Source
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();

See Configuration for more information on the configuration options.

Structs§

BigEndian
Encodes all integer types in big endian.
Configuration
The Configuration struct is used to build bincode configurations. The Config trait is implemented by this struct when a valid configuration has been constructed.
Fixint
Use fixed-size integer encoding.
Limit
Sets the byte limit to N.
LittleEndian
Encodes all integer types in little endian.
NoLimit
Sets an unlimited byte limit.
Varint
Use variable integer encoding.

Enums§

Endianness
Endianness of a Configuration.
IntEncoding
Integer Encoding of a Configuration.

Traits§

Config
Indicates a type is valid for controlling the bincode configuration

Functions§

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