1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
use super::*; /// Queueing and draining methods for `WindowCommandQueue`. impl WindowCommandQueue { /// Pushes a window command onto the queue. /// /// # Arguments /// /// - `&Self` - Mutable command queue. /// - `WindowCommand` - Command to enqueue. pub fn push(&mut self, command: WindowCommand) { self.get_mut_commands().push(command); } /// Drains all queued commands in FIFO order. /// /// # Arguments /// /// - `&Self` - Mutable command queue. /// /// # Returns /// /// - `Vec<WindowCommand>` - Drained commands. pub fn drain(&mut self) -> Vec<WindowCommand> { take(self.get_mut_commands()) } /// Returns true when no window commands are pending. /// /// # Arguments /// /// - `&Self` - Command queue reference. /// /// # Returns /// /// - `bool` - True when empty. #[must_use] pub fn is_empty(&self) -> bool { self.get_commands().is_empty() } }