Trait ReactiveMessagingDeserializer

Source
pub trait ReactiveMessagingDeserializer<T> {
    // Required method
    fn deserialize(
        remote_message: &[u8],
    ) -> Result<T, Box<dyn Error + Sync + Send>>;
}
Expand description

Trait that should be implemented by enums that model the “remote messages” to be consumed by a “Responsive Processor” – “remote messages” may either be messages produced by the remote server or by the remote client (when we are implementing the opposite peer).
This trait, therefore, specifies how to deserialize() enum variants received by the remote peer (like RON, for textual protocols)

Required Methods§

Source

fn deserialize(remote_message: &[u8]) -> Result<T, Box<dyn Error + Sync + Send>>

Local messages deserializer: transform a textual message into a string typed value.
IMPLEMENTORS: #[inline(always)]

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.

Implementations on Foreign Types§

Source§

impl ReactiveMessagingDeserializer<String> for String

Testable implementation for our text-only protocol as used across this module

Source§

fn deserialize( message: &[u8], ) -> Result<String, Box<dyn Error + Sync + Send + 'static>>

Implementors§