pub struct CommandQueue { /* private fields */ }Expand description
Command queue for batching protocol commands before transmission. Commands are aggregated into larger packets to improve bandwidth utilization.
Implementations§
Source§impl CommandQueue
impl CommandQueue
Sourcepub fn enqueue(&mut self, command: ProtocolCommand) -> bool
pub fn enqueue(&mut self, command: ProtocolCommand) -> bool
Enqueues a protocol command for later processing. Returns true if the queue should be flushed (reached max size).
Sourcepub fn drain(&mut self) -> impl Iterator<Item = ProtocolCommand> + '_
pub fn drain(&mut self) -> impl Iterator<Item = ProtocolCommand> + '_
Drains all commands from the queue for processing.
Sourcepub fn iter(&self) -> impl Iterator<Item = &ProtocolCommand>
pub fn iter(&self) -> impl Iterator<Item = &ProtocolCommand>
Returns an iterator over the commands without draining.
Trait Implementations§
Source§impl Debug for CommandQueue
impl Debug for CommandQueue
Auto Trait Implementations§
impl Freeze for CommandQueue
impl RefUnwindSafe for CommandQueue
impl Send for CommandQueue
impl Sync for CommandQueue
impl Unpin for CommandQueue
impl UnwindSafe for CommandQueue
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