pub struct CommandEncoder;Expand description
Serializes a command packet into bytes for transmission.
Implementations§
Source§impl CommandEncoder
impl CommandEncoder
Sourcepub fn encode_command_into(
buffer: &mut Vec<u8>,
command: &ProtocolCommand,
) -> Result<()>
pub fn encode_command_into( buffer: &mut Vec<u8>, command: &ProtocolCommand, ) -> Result<()>
Encodes a single command into the provided buffer (appends bytes).
Sourcepub fn encode_packet_into(
buffer: &mut Vec<u8>,
packet: &CommandPacket,
) -> Result<()>
pub fn encode_packet_into( buffer: &mut Vec<u8>, packet: &CommandPacket, ) -> Result<()>
Encodes a command packet into the provided buffer (appends bytes) without intermediate allocations per command.
Sourcepub fn encode_command(command: &ProtocolCommand) -> Result<Vec<u8>>
pub fn encode_command(command: &ProtocolCommand) -> Result<Vec<u8>>
Encodes a single command into a byte vector
Sourcepub fn encode_packet(packet: &CommandPacket) -> Result<Vec<u8>>
pub fn encode_packet(packet: &CommandPacket) -> Result<Vec<u8>>
Encodes a command packet with multiple commands
Auto Trait Implementations§
impl Freeze for CommandEncoder
impl RefUnwindSafe for CommandEncoder
impl Send for CommandEncoder
impl Sync for CommandEncoder
impl Unpin for CommandEncoder
impl UnwindSafe for CommandEncoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more