Trait SerializeMessage

Source
pub trait SerializeMessage:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn serialize(&self) -> Result<Vec<u8>>;
    fn deserialize(message: &[u8]) -> Result<Self>;
}
Expand description

Trait a message type needs to implement to be usable with the TCPClient/TCPServer implementation. This allows to customize the serialization format.

Required Methods§

Source

fn serialize(&self) -> Result<Vec<u8>>

Source

fn deserialize(message: &[u8]) -> Result<Self>

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.

Implementors§