Struct cqc::Encoder [−][src]
pub struct Encoder { /* fields omitted */ }
Packet encoder.
A basic packet encoder
Methods
impl Encoder
[src]
impl Encoder
pub fn new() -> Encoder
[src]
pub fn new() -> Encoder
Create a big endian Encoder
.
pub fn encode<'buf>(&self, request: &Request, buffer: &'buf mut [u8]) -> usize
[src]
pub fn encode<'buf>(&self, request: &Request, buffer: &'buf mut [u8]) -> usize
Encode a CQC request packet into buffer of bytes. The return value is a the number of bytes written.
If the provided buffer is not large enough to encode the request
encode_request
will panic.
pub fn into_vec(&self, request: &Request) -> Vec<u8>
[src]
pub fn into_vec(&self, request: &Request) -> Vec<u8>
Encode a CQC request packet into a newly allocated vector of bytes.