pub trait Command {
const CMD_NAME: &'static [u8];
// Required methods
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§
Required Methods§
Sourcefn into_vec(self) -> Result<Bytes, CommandError>
fn into_vec(self) -> Result<Bytes, CommandError>
Encodes the command into bytes
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.