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
unitwhen possible. - serialize_
array - Encodes an array from element units.
- serialize_
array_ at - Encodes array elements written since the caller-provided
lastlength. - 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
lastas 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
lastbuffer length. - serialize_
scalar - Encodes a scalar as an inline field unit.
- serialize_
str - Encodes a UTF-8 string using the ProtoCache byte-string representation.