Expand description
Variable-length integers (RFC 9000 §16) and a bounds-checked reader.
Structs§
- Reader
- A cursor over a byte slice; every read is bounds-checked.
Constants§
- VARINT_
MAX - Largest value a varint can hold (2^62 - 1).
Functions§
- get_
varint - Decodes a single varint from the front of
buf. - put_
varint - Appends
vas a varint. Panics in debug builds whenvexceedsVARINT_MAX. - put_
varint_ fixed - Writes
vas a varint of exactlylenbytes (used for patched length fields). - varint_
len - Encoded size of
vin bytes (1, 2, 4 or 8).vmust be at mostVARINT_MAX.