Skip to main content

Module bincode

Module bincode 

Source

Modules§

config
The config module is used to change the behavior of bincode’s encoding and decoding logic.
de
Decoder-based structs and traits.
enc
Encoder-based structs and traits.
error
Errors that can be encounting by Encoding and Decoding.
serde
Support for serde integration. Enable this with the serde feature.

Macros§

impl_borrow_decode
Helper macro to implement BorrowDecode for any type that implements Decode.
impl_borrow_decode_with_context
Helper macro to implement BorrowDecode for any type that implements Decode.

Structs§

BytesReader
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.
LittleEndian
Encodes all integer types in little endian.
ZeroCopyBytes

Enums§

DecodeError
Errors that can be encountered by decoding a type

Traits§

BorrowDecode
Trait that makes a type able to be decoded, akin to serde’s Deserialize trait.
BytesReaderExt
Extension methods for a Reader that is backed by Bytes.
Config
Indicates a type is valid for controlling the bincode configuration
Decode
Trait that makes a type able to be decoded, akin to serde’s DeserializeOwned trait.
DecodeBytes
Decoder
Any source that can decode basic types. This type is most notably implemented for Decoder.
Encode
Any source that can be encoded. This trait should be implemented for all types that you want to be able to use with any of the encode_with methods.
Reader
A reader for owned data. See the module documentation for more information.

Functions§

borrow_decode_from_slice
Attempt to decode a given type D from the given slice. Returns the decoded output and the amount of bytes read.
borrow_decode_from_slice_with_context
Attempt to decode a given type D from the given slice with Context. Returns the decoded output and the amount of bytes read.
decode_from_bytes
decode_from_reader
Attempt to decode a given type D from the given Reader.
decode_from_slice
Attempt to decode a given type D from the given slice. Returns the decoded output and the amount of bytes read.
decode_from_slice_with_context
Attempt to decode a given type D from the given slice with Context. Returns the decoded output and the amount of bytes read.
decode_from_std_read
Decode type D from the given reader with the given Config. The reader can be any type that implements std::io::Read, e.g. std::fs::File.
decode_from_std_read_with_context
Decode type D from the given reader with the given Config and Context. The reader can be any type that implements std::io::Read, e.g. std::fs::File.
encode_into_slice
Encode the given value into the given slice. Returns the amount of bytes that have been written.
encode_into_std_write
Encode the given value into any type that implements std::io::Write, e.g. std::fs::File, with the given Config. See the config module for more information. Returns the amount of bytes written.
encode_into_writer
Encode the given value into a custom Writer.
encode_to_vec
Encode the given value into a Vec<u8> with the given Config. See the config module for more information.

Derive Macros§

BorrowDecode
Decode
Encode