module
Proto::HasUnknownFields
Overview
Mixin that adds unknown field capture and re-serialization to a message class.
Include this module inside any class that inherits Proto::Message to get: capture_unknown_field(reader, field_number, wire_type) write_unknown_fields(writer)
Direct including types
- Proto::Bootstrap::CodeGeneratorRequest
- Proto::Bootstrap::CodeGeneratorResponse
- Proto::Bootstrap::CodeGeneratorResponseFile
- Proto::Bootstrap::DescriptorProto
- Proto::Bootstrap::EnumDescriptorProto
- Proto::Bootstrap::EnumValueDescriptorProto
- Proto::Bootstrap::FieldDescriptorProto
- Proto::Bootstrap::FieldOptions
- Proto::Bootstrap::FileDescriptorProto
- Proto::Bootstrap::MessageOptions
- Proto::Bootstrap::MethodDescriptorProto
- Proto::Bootstrap::MethodOptions
- Proto::Bootstrap::OneofDescriptorProto
- Proto::Bootstrap::ServiceDescriptorProto
- Proto::Message
Defined in:
proto/unknown_field.crInstance Method Summary
-
#add_unknown_varint(field_number : Int32, value : UInt64) : Nil
Append a raw unknown varint value when a field cannot be decoded semantically (for example, unknown enum numeric values under strict enum APIs).
- #capture_unknown_field(reader : Wire::Reader, field_number : Int32, wire_type : Int32) : Nil
- #capture_unknown_field(field : UnknownField) : Nil
- #decode_known_enum(field_number : Int32, raw_u64 : UInt64, & : Int32 -> ) : Nil
-
#extension_value?(descriptor : T) : ExtensionValue | Nil forall T
Returns the last matching extension value (proto singular semantics) or nil.
-
#extension_values(descriptor : T) : Array(ExtensionValue) forall T
Returns all matching extension values in wire order.
-
#has_extension?(descriptor : T) : Bool forall T
Returns true when at least one unknown field matches the descriptor and can be decoded as an extension value.
- #unknown_fields : Array(UnknownField)
- #write_unknown_fields(writer : Wire::Writer) : Nil
Instance Method Detail
Append a raw unknown varint value when a field cannot be decoded semantically (for example, unknown enum numeric values under strict enum APIs).
Returns the last matching extension value (proto singular semantics) or nil.
Returns all matching extension values in wire order.
Returns true when at least one unknown field matches the descriptor and can be decoded as an extension value.