Skip to main content

Module helpers

Module helpers 

Source

Structs§

VarintResult
Result of parsing one protobuf varint from a byte slice.
WiretagResult
Result of parsing one protobuf wire tag (field number + wire type).

Constants§

WT_END_GROUP
WT_I32
WT_I64
WT_LEN
WT_START_GROUP
WT_VARINT

Functions§

decode_bool
Decode varint as bool (0 → false, 1 → true).
decode_double
Decode 8 little-endian bytes as f64.
decode_fixed32
Decode 4 little-endian bytes as fixed32 (uint32).
decode_fixed64
Decode 8 little-endian bytes as fixed64 (uint64).
decode_float
Decode 4 little-endian bytes as f32.
decode_int32
Decode varint as int32 (two’s complement, low 32 bits).
decode_int64
Decode varint as int64 (two’s complement).
decode_sfixed32
Decode 4 little-endian bytes as sfixed32 (int32).
decode_sfixed64
Decode 8 little-endian bytes as sfixed64 (int64).
decode_sint32
Decode varint as sint32 (zig-zag).
decode_sint64
Decode varint as sint64 (zig-zag).
decode_uint32
Decode varint as uint32.
decode_uint64
Decode varint as uint64.
encode_varint_bytes
Encode a varint value (with optional overhang bytes) back to bytes.
parse_varint
Parse one protobuf varint starting at start in buf.
parse_wiretag
Parse one wire tag starting at start in buf.
write_bool_field
Append a bool field (VARINT) to buf — only written when true.
write_fixed32_field
Append a fixed-32 field to buf.
write_fixed64_field
Append a fixed-64 field to buf.
write_len_field
Append a LEN-delimited field to buf.
write_opt_varint_field
Append an optional VARINT field to buf — only written when Some.
write_tag
Append a field tag (wire_type 0–5) to buf.
write_varint
Append a raw varint encoding of value to buf.
write_varint_field
Append a VARINT field to buf.
write_varint_ohb
Append a varint encoding of value (with optional overhang bytes) directly into out, with no allocation.