pub struct CommandPacket {
pub commands: Vec<ProtocolCommand>,
pub timestamp: Instant,
}Expand description
Aggregated packet containing multiple protocol commands.
Aggregates commands into larger packets to reduce overhead and improve bandwidth utilization.
Fields§
§commands: Vec<ProtocolCommand>Protocol commands in this packet
timestamp: InstantTimestamp when packet was created
Implementations§
Source§impl CommandPacket
impl CommandPacket
Sourcepub fn single(command: ProtocolCommand) -> Self
pub fn single(command: ProtocolCommand) -> Self
Creates a command packet with a single command
Sourcepub fn add_command(&mut self, command: ProtocolCommand)
pub fn add_command(&mut self, command: ProtocolCommand)
Adds a command to this packet
Trait Implementations§
Source§impl Clone for CommandPacket
impl Clone for CommandPacket
Source§fn clone(&self) -> CommandPacket
fn clone(&self) -> CommandPacket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandPacket
impl Debug for CommandPacket
Auto Trait Implementations§
impl Freeze for CommandPacket
impl RefUnwindSafe for CommandPacket
impl Send for CommandPacket
impl Sync for CommandPacket
impl Unpin for CommandPacket
impl UnwindSafe for CommandPacket
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