Protobuf generated structs and traits for conversion.
The central part of this module is
The main purpose of this trait is to allow
users to create a map between their types and the types generated from .proto descriptions, while
providing a mechanism for additional validation of protobuf data.
Most of the time you do not have to implement this trait because most of the use cases are covered
A typical example of such mapping with validation is manual implementation of this trait for
crypto::Hash is a fixed sized array of bytes but protobuf does not allow us to express this constraint since
only dynamically sized arrays are supported.
If you would like to use
Hash as a part of your
protobuf struct, you would have to write a conversion function from protobuf
is dynamically sized array of bytes) to
crypto::Hash and call it every time when you want to
crypto::Hash in your application.
ProtobufConvert implementation for Hash allows you to embed this field into your
struct and generate
ProtobufConvert for it using
#[derive(ProtobufConvert)], which will validate
your struct based on the validation function for
Module of the rust-protobuf generated files.
Used for establishing correspondence between rust struct and protobuf rust struct
ProtobufConvert derive macro.