pub trait ProtobufValue: Sized {
type Message: Message + Default;
// Required methods
fn to_proto(&self) -> Self::Message;
fn from_proto(message: Self::Message) -> Result<Self, PersistenceError>;
}Expand description
Defines the stored representation and domain validation for one type.
Required Associated Types§
Required Methods§
Sourcefn from_proto(message: Self::Message) -> Result<Self, PersistenceError>
fn from_proto(message: Self::Message) -> Result<Self, PersistenceError>
Builds the domain value and checks its construction constraints.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".