pub trait MessageTranslator<W, D>:
Send
+ Sync
+ 'static {
// Required methods
fn serialize(&self, domain: &D) -> AppResult<W>;
fn deserialize(&self, raw: &W) -> AppResult<D>;
}Expand description
Translates messages between wire format and domain types.
W is the wire type carried inside Message<W> and
D is the domain type the application works with.
Required Methods§
Sourcefn deserialize(&self, raw: &W) -> AppResult<D>
fn deserialize(&self, raw: &W) -> AppResult<D>
Deserializes wire format to domain type.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".