pub trait ProtoMessage: Default + MessagePath {
const PACKAGE: &str;
const SHORT_NAME: &str;
// Required methods
fn proto_schema() -> MessageSchema;
fn proto_name() -> &'static str;
fn full_name() -> &'static str;
fn type_url() -> &'static str;
}Expand description
A trait that is responsible for generating a protobuf schema representation for a rust struct.
Implemented by the proto_message macro.
Required Associated Constants§
Sourceconst SHORT_NAME: &str
const SHORT_NAME: &str
The short name of the message. It excludes the names of the parent message and package.
Required Methods§
Sourcefn proto_schema() -> MessageSchema
fn proto_schema() -> MessageSchema
Returns the protobuf schema representation.
Sourcefn proto_name() -> &'static str
fn proto_name() -> &'static str
Returns the name of the message, with the name of the parent message if there is one (i.e. “ParentMessage.ChildMessage”).
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.