Module reflect

Source
Expand description

§Reflection implementation for protobuf data

§Generated vs dynamic

rust-protobuf supports reflection for both:

  • generated messages (generated rust code)
  • dynamic messages (created from arbitrary FileDescriptorProto without code generation)

The API to work with these types of messages is the same.

§API

The API roughly follows Google protobuf C++ and Java API. Some minor adjustements are made to make code more idiomatic to rust.

Structs§

EnumDescriptor
Dynamic representation of enum type.
EnumValueDescriptor
Description for enum variant.
FieldDescriptor
Field descriptor.
FileDescriptor
Reflection for objects defined in .proto file (messages, enums, etc).
MessageDescriptor
Dynamic representation of message type.
MessageRef
Wrapper around either MessageFull reference or a container for an empty dynamic message.
MethodDescriptor
Service method descriptor.
OneofDescriptor
Oneof descriptor.
ReflectEqMode
Parameter for ReflectEq.
ReflectMapMut
Dynamic mutable reference to map field
ReflectMapRef
Dynamic reference to map field
ReflectOptionalRef
Singular field field and value type.
ReflectRepeatedMut
Dynamic mutable reference to repeated field
ReflectRepeatedRef
Dynamic reference to repeated field
ServiceDescriptor
Dynamic representation of service type.

Enums§

ReflectFieldRef
Reference to a value stored in a field, optional, repeated or map.
ReflectValueBox
Owner value of any elementary type
ReflectValueRef
A reference to a value
RuntimeFieldType
Reflective representation of field type.
RuntimeType
Runtime representation of elementary protobuf type.
Syntax
.proto file syntax.

Traits§

ProtobufValue
Type implemented by all protobuf singular types (primitives, string, messages, enums).
ReflectEq
Special version of eq.