Expand description
Wire format encoding and decoding primitives.
Implements the protobuf binary wire format: varints, fixed-width integers, length-delimited fields, and tag parsing.
Structs§
- Tag
- A parsed field tag (field number + wire type).
Enums§
- Wire
Type - Protobuf wire types.
Constants§
- FIRST_
RESERVED_ FIELD_ NUMBER - The first field number of the band reserved for the protobuf implementation, 19000.
- LAST_
RESERVED_ FIELD_ NUMBER - The last field number of the implementation-reserved band, 19999
(inclusive). See
FIRST_RESERVED_FIELD_NUMBER. - MAX_
FIELD_ NUMBER - The maximum valid protobuf field number, 2^29 − 1.
Functions§
- check_
wire_ type - Verify a decoded tag carries the expected wire type.
- count_
varints - Count the varints in a packed payload, i.e. the number of bytes whose
continuation bit is clear (
b < 0x80). - decode_
unknown_ field - Decode one unknown field’s value from
bufand return it as anUnknownField. - decode_
varint - Decode a varint from a buffer.
- encode_
varint - Encode a varint to a buffer.
- skip_
field - Skip one field value from
bufaccording to the wire type intag. - skip_
field_ depth - Skip a field’s payload, with an explicit recursion depth budget for groups.
- skip_
unknown_ field - Skip an unknown wire field while enforcing explicit unknown-field rejection.
- varint_
len - Compute the encoded length of a varint.
- wire_
type_ mismatch - Construct a
DecodeError::WireTypeMismatchfortag.