Skip to main content

ProtoMessage

Trait ProtoMessage 

Source
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§

Source

const PACKAGE: &str

The package to which this message belongs.

Source

const SHORT_NAME: &str

The short name of the message. It excludes the names of the parent message and package.

Required Methods§

Source

fn proto_schema() -> MessageSchema

Returns the protobuf schema representation.

Source

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”).

Source

fn full_name() -> &'static str

Returns the full name of the message, which includes the name of the ancestor messages (if there are any) and the package to which it belongs (i.e. “package.Parent.Child”).

Source

fn type_url() -> &'static str

Returns the type url for this type, which is the full name preceded by a ‘/’.

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.

Implementors§