pub trait MessageFull:
Message
+ ProtobufValue
+ Debug
+ Display {
// Required method
fn descriptor() -> MessageDescriptor;
// Provided method
fn reflect_eq(&self, other: &Self, mode: &ReflectEqMode) -> bool { ... }
}
Expand description
Trait implemented for all the generated messages, except when lite runtime is enabled.
When lite runtime is enabled, only MessageLite
is implemented.
- Generated messages are generated from
.proto
files - Dynamic messages can be created without code generation using only parsed proto files (see FileDescriptor::new_dynamic).
Also, generated messages implement Default + PartialEq
This trait is sized, there’s accompanying MessageDyn
trait
which is implemented for all messages which can be used in functions
without making message a function type parameter.
§Display
Display
implementation for messages does protobuf text format.
See text_format
for more details.
Required Methods§
Sourcefn descriptor() -> MessageDescriptor
fn descriptor() -> MessageDescriptor
Get message descriptor for message type.
let descriptor = MyMessage::descriptor();
assert_eq!("MyMessage", descriptor.name());
Provided Methods§
Sourcefn reflect_eq(&self, other: &Self, mode: &ReflectEqMode) -> bool
fn reflect_eq(&self, other: &Self, mode: &ReflectEqMode) -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.