Struct std::PbReader
struct PbReader {
[]const unsigned char data;
unsigned long pos;
}Fields
Methods
A reader positioned at the start of data.
Each returns 1 on success, 0 on a truncated/malformed encoding (ran out of bytes mid-varint, length-delimited field's declared length exceeds the remaining buffer, etc.).
The field's bytes, a slice of the reader's own buffer (see the zero-copy note above) — copy it out (e.g. String::from_bytes) if it needs to outlive that buffer. null on a truncated encoding.
Advances past one field's value without decoding it, given its wire type from a just-read tag — the standard "ignore fields I don't recognize" behavior every protobuf reader needs for forward compatibility with schemas that gained fields since this code was written. Returns 0 for wire type 3/4 (unsupported group markers) or a truncated encoding.