pub trait MessageProxy: From<Self::Message> + Into<Self::Message> {
type Message: ProtoMessage + ValidatedMessage + From<Self> + Into<Self>;
// Provided methods
fn into_message(self) -> Self::Message { ... }
fn into_validated_message(self) -> Result<Self::Message, ValidationErrors> { ... }
fn from_validated_message(
msg: Self::Message,
) -> Result<Self, ValidationErrors> { ... }
}Expand description
Implemented for message proxies by the proto_message macro.
Required Associated Types§
type Message: ProtoMessage + ValidatedMessage + From<Self> + Into<Self>
Provided Methods§
Sourcefn into_message(self) -> Self::Message
fn into_message(self) -> Self::Message
Converts into the associated message.
Sourcefn into_validated_message(self) -> Result<Self::Message, ValidationErrors>
fn into_validated_message(self) -> Result<Self::Message, ValidationErrors>
Consumes the proxy and converts into the related message, and then validates the result.
Sourcefn from_validated_message(msg: Self::Message) -> Result<Self, ValidationErrors>
fn from_validated_message(msg: Self::Message) -> Result<Self, ValidationErrors>
Validates the message, and converts to the proxy if the validation is successful.
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.