Page
Library
Module
Module type
Parameter
Class
Class type
Source
Pbrt.DecoderSourceDecoding protobufs.
The decoder
type error = | Incomplete| Overlong_varint| Malformed_field| Overflow of string| Unexpected_payload of string * payload_kind| Missing_field of string| Malformed_variant of stringerror_to_string e converts error e to its string representation.
malformed_variant variant_name raises the exception Protobuf.Decoder.Failure (Malformed_variant variant_name)
unexpected_payload field_name pk raises the exception Protobuf.Decoder.Failure (Unexpected_payload (field_name, pk))
missing_field field_name raises the exception Protobuf.Decoder.Failure (Missing_field field_name)
key d reads a key and a payload kind from d. If d has exhausted its input when the function is called, returns None. If d has exhausted its input while reading, raises Failure Incomplete. If the payload kind is unknown, raises Failure Malformed_field.
skip d pk skips the next value of kind pk in d. If skipping the value would exhaust input of d, raises Encoding_error Incomplete.
nested d returns a decoder for a message nested in d. If reading the message would exhaust input of d, raises Failure Incomplete.
empty_nested d skips an empty message of 0 length. If reading the message would exhaust input of d, raises Failure Incomplete.
packed_fold f e0 d folds over the a packed encoding with f acc d and initial value e0. If reading the message would exhaust input of d, raises Failure Incomplete.
int_as_varint d reads an int value from d with Varint encoding. If the integer value read cannot be converted to int raises Failure Overflow "". If reading the message would exhaust input of d, raises Failure Incomplete.
int_as_zigzag d reads an int value from d with zigzag encoding. If the integer value read cannot be converted to int raises Failure Overflow "". If reading the message would exhaust input of d, raises Failure Incomplete.
int32_as_varint d reads an int32 value from d with Varint encoding. If the integer value read cannot be converted to int32 raises Failure Overflow "". If reading the message would exhaust input of d, raises Failure Incomplete.
int32_as_varint d reads an int32 value from d with zigzag encoding. If the integer value read cannot be converted to int32 raises Failure Overflow "". If reading the message would exhaust input of d, raises Failure Incomplete.
int64_as_varint d reads an int64 value from d with Varint encoding. If reading the message would exhaust input of d, raises Failure Incomplete.
int64_as_varint d reads an int64 value from d with zigzag encoding. If reading the message would exhaust input of d, raises Failure Incomplete.
int32_as_bits32 d reads an int32 value from d with 32 bit encoding. If reading the message would exhaust input of d, raises Failure Incomplete.
int64_as_bits64 d reads an int64 value from d with 64 bit encoding. If reading the message would exhaust input of d, raises Failure Incomplete.
bool d reads a bool value from d with varing encoding. If the boolean value in d is neither 0 or 1 raises Failure Overflow "". If reading the message would exhaust input of d, raises Failure Incomplete.
float_as_bits32 d reads a float value from d with 32 bit encoding. If reading the message would exhaust input of d, raises Failure Incomplete.
float_as_bits64 d reads a float value from d with 64 bit encoding. If reading the message would exhaust input of d, raises Failure Incomplete.
int_as_bits32 d reads a int value from d with 32 bit encoding. If the integer value read cannot be converted to int raises Failure Overflow "". If reading the message would exhaust input of d, raises Failure Incomplete.
int_as_bits64 d reads a int value from d with 64 bit encoding. If the integer value read cannot be converted to int raises Failure Overflow "". If reading the message would exhaust input of d, raises Failure Incomplete.
string d reads a string value from d. If reading the message would exhaust input of d, raises Failure Incomplete.
bytes d reads a bytes value from d. If reading the message would exhaust input of d, raises Failure Incomplete.