Trait hematite_server::packet::PacketWrite [] [src]

pub trait PacketWrite {
    fn inner_len(&self) -> usize;
    fn inner_encode(&self, dst: &mut Write) -> Result<()>;

    fn write(&self, dst: &mut Write) -> Result<()> { ... }
}

A trait for encoding the body of a single packet type.

Required Methods

fn inner_len(&self) -> usize

fn inner_encode(&self, dst: &mut Write) -> Result<()>

Provided Methods

fn write(&self, dst: &mut Write) -> Result<()>

Writes a full packet to a writer, including length.

TODO: add support for compression.

Implementors