Expand description
Typed scalar reads and container headers.
Functions§
- array_
header - Return the number of elements and the offset of the first element,
for the array starting at
offset. ReturnsNoneif not an array. - map_
header - Return the number of key-value pairs and the offset of the first pair,
for the map starting at
offset. ReturnsNoneif not a map. - read_
bin_ advance - Read a
binvalue at*off, advancing*offpast it. Zero-copy — the returned slice borrows frombuf. ReturnsNonefor non-bin tags or truncated input. - read_
bool - Read a boolean from the value at
offset. - read_
f64 - Read an f64 from the value at
offset. Handles float32, float64, and all integer types (coerced to f64). - read_
i64 - Read an i64 from the value at
offset. Handles all integer types. Floats returnNone— useread_f64for those. Auint64abovei64::MAXreturnsNone— useread_integerfor the exact value. - read_
integer - Read any msgpack integer at
offsetexactly.i128holds everyi64and everyu64. Floats and non-integers returnNone. - read_
null - Check if the value at
offsetis nil. - read_
str - Read a string slice from the value at
offset. Zero-copy — borrows directly from the input buffer. ReturnsNonefor non-string types or invalid UTF-8. - read_
str_ advance - Read a string slice at
*off, advancing*offpast it. Zero-copy. ReturnsNonefor non-string types, invalid UTF-8, or truncated input. - read_
u32_ advance - Read an unsigned integer that fits in a
u32at*off, advancing*offpast it. Accepts positive fixint, uint8, uint16, uint32. ReturnsNonefor negative, signed-typed, oversized (uint64), or non-integer values.