Trait nitox::Command

source ·
pub trait Command {
    const CMD_NAME: &'static [u8];

    fn into_vec(self) -> Result<Bytes, CommandError>;
    fn try_parse(buf: &[u8]) -> Result<Self, CommandError>
    where
        Self: Sized
; }
Expand description

Trait used to implement a common interface for implementing new commands

Required Associated Constants

Command name as a static byte slice

Required Methods

Encodes the command into bytes

Tries to parse a buffer into a command

Implementors