Skip to main content

Module serialize

Module serialize 

Source
Expand description

Low-level encoding primitives for schema-independent writers. Serialization surface matching serialize.h.

Re-exports§

pub use crate::Buffer;

Structs§

Segment
A contiguous range stored in a reverse-growing Buffer.
Unit
Intermediate representation of an encoded field.

Functions§

build_perfect_hash_index
Builds a ProtoCache perfect-hash index for unique encoded keys.
build_perfect_hash_index_with_positions
Builds a perfect-hash index and reports each input key’s storage position.
fold_field
Moves a small buffered segment into the inline storage of unit when possible.
serialize_array
Encodes an array from element units.
serialize_array_at
Encodes array elements written since the caller-provided last length.
serialize_array_at_mut
Encodes array elements written since last, updating their segment metadata.
serialize_bool
Encodes a boolean as an inline field unit.
serialize_bytes
Encodes a byte string into buffer.
serialize_map
Encodes a map from canonical key bytes and key/value field units.
serialize_map_at
Encodes map key/value units and their perfect-hash index using last as the boundary for referenced buffer segments.
serialize_map_at_mut
Encodes map key/value units and their perfect-hash index from mutable inputs.
serialize_message
Encodes a message from zero-based field units.
serialize_message_at
Encodes message fields, restricting referenced segments to data written since the caller-provided last buffer length.
serialize_scalar
Encodes a scalar as an inline field unit.
serialize_str
Encodes a UTF-8 string using the ProtoCache byte-string representation.