Trait mz_proto::ProtoType

source ·
pub trait ProtoType<Rust>: Sized {
    fn into_rust(self) -> Result<Rust, TryFromProtoError>;
    fn from_rust(rust: &Rust) -> Self;
}
Expand description

The symmetric counterpart of RustType, similar to what Into is to From.

The Rust parameter is generic, as opposed to the Proto associated type in RustType because the same Protobuf type can be used to encode many different Rust types.

Clients should only implement RustType.

Required Methods§

Implementors§

Blanket implementation for ProtoType, so clients only need to implement RustType.