Field Decoders
Dispatches field types to concrete decoders, including quantized float handling and packed value decoding.
See also: How Proto Parsing Works
Generated API
gem.field_decoder.find_decoder
find_decoder
python
def find_decoder(field: _FieldLike) -> FieldDecoderReturn the appropriate decoder for the given field.
Source: src/gem/field_decoder.py:403
gem.field_decoder.find_decoder_by_base_type
find_decoder_by_base_type
python
def find_decoder_by_base_type(base_type: str) -> FieldDecoderReturn a decoder for a base type string without field context.
Source: src/gem/field_decoder.py:435
gem.field_decoder.QuantizedFloatDecoder
QuantizedFloatDecoder
python
class QuantizedFloatDecoderDecoder for Source 2 quantized floats (CNetworkedQuantizedFloat).
Source: src/gem/field_decoder.py:66
Methods
decode
Signature: def QuantizedFloatDecoder.decode(self, r: BitReader) -> float
Read and decode one quantized float from r.
Source: src/gem/field_decoder.py:180