pub trait SocketServerDeserializer<T> {
    // Required method
    fn deserialize(
        local_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 handled by the [SocketServer] – “remote messages” are, typically, client messages (see [ClientMessages]) – but may also be server messages if we’re building a client (for tests?)
This trait, therefore, specifies how to:

  • deserialize() enum variants received by the remote peer (like RON, for textual protocols)

Required Methods§

source

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

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

Implementations on Foreign Types§

source§

impl SocketServerDeserializer<String> for String

Testable implementation for our text-only protocol

source§

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

Implementors§