pub trait MessageTrait {
    // Required methods
    fn name(&self) -> String;
    fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>;
    fn deserialize(bytes: BytesMut) -> Result<Self>
       where Self: Sized;
}

Required Methods§

source

fn name(&self) -> String

Returns the message name.

source

fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>

Serializes the message into the buffer.

source

fn deserialize(bytes: BytesMut) -> Result<Self>where Self: Sized,

Deserializes the given buffer into a message.

Implementors§