Trait DomainType
pub trait DomainType:
Sized
+ Clone
+ TryFrom<Self::Proto>{
type Proto: Message + Name + Default + From<Self> + Send + Sync + 'static;
// Provided methods
fn encode_to_vec(&self) -> Vec<u8> ⓘ { ... }
fn to_proto(&self) -> Self::Proto { ... }
fn decode<B>(buf: B) -> Result<Self, Error>
where B: Buf { ... }
}Expand description
A marker type that captures the relationships between a domain type (Self) and a protobuf type (Self::Proto).
Required Associated Types§
Provided Methods§
fn encode_to_vec(&self) -> Vec<u8> ⓘ
fn encode_to_vec(&self) -> Vec<u8> ⓘ
Encode this domain type to a byte vector, via proto type P.
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.