Module alkahest::advanced

source ·
Expand description

This module contains types and functions for manual implementations of Serialize and Deserialize traits.

Structs

  • Fixed buffer without bound checks. If buffer is too small to fit serialized data, it will panic.
  • Deserializer from raw bytes. Provides methods for deserialization of values.
  • Type used to represent sizes and offsets in serialized data. This places limitation on sequence sizes which practically is never hit. usize itself is not portable and cannot be written into alkahest package.
  • Buffer that writes to a slice. If buffer is too small to fit serialized data it keeps pretends to work and tracks the size of the values that would be written. Returns BufferSizeRequired error if serialized data is too big.
  • Heap and stack sizes.
  • Writes elements of a slice one by one into associated buffer.
  • Extensible buffer that writes to a vector. If buffer is too small to fit serialized data it extends the vector. Never returns an error, cannot fail to serialize data except for OOM error.

Traits

  • Ad-hoc negative trait. It should be implemented for most formulas. Except for formulas with generic implementation of Serialize and Deserialize traits via another Formula.
  • Buffer API that is used by serializer. Buffers can be extensible or fixed size. Extensible buffers grow automatically when needed.

Functions

Type Definitions

  • Type used to represent sizes and offsets in serialized data.