Skip to main content

Module wire

Module wire 

Source
Expand description

Reading and writing the primitive values that ABI records are built out of.

Everything on the wire is little-endian, because every machine anyone is going to run this on is little-endian and pretending otherwise would cost real instructions in the hot path for a portability nobody is asking for. If that ever stops being true it is a new ABI major version, not a runtime flag.

Variable-length fields are padded so that the cursor lands back on a multiple of eight. That costs at most seven bytes per field and it means a later version of this crate can read a fixed width run of a record by pointing at it instead of copying it out field by field.

Structs§

Reader
A cursor that reads ABI values out of a byte slice.
Writer
A cursor that writes ABI values into a byte slice.

Constants§

ALIGN
How wide the alignment of a record payload is, in bytes.

Functions§

align_up
Rounds n up to the next multiple of ALIGN.