Module encoders

Source
Expand description

Encoders for encoding data into byte slices.

This module contains different types that implement the Encoder trait. As a summary, these types implement the Encodable trait:

  • (): does nothing when encoding. Useful for testing.
  • SizeEncoder: counts the number of bytes written.
  • &mut [u8]: writes bytes into a slice, if there is enough space.
  • Vec<u8> (std or alloc feature): writes bytes into a vector that grows if necessary.
  • ArrayVec (arrayvec feature): writes bytes into an ArrayVec, if there is enough space.

Structsยง

InsufficientSpace
An error that occurs when the provided buffer has no space left for encoding.
SizeEncoder
An encoder that counts the size of the encoded data.