(&mut self, item: T)
| 42 | |
| 43 | impl<const SIZE: usize, T: Copy> Queue<T> for Buffer<SIZE, T> { |
| 44 | fn enqueue(&mut self, item: T) { |
| 45 | if self.tail == SIZE - 1 { |
| 46 | // Discard the data. we are buffer oerflow. |
| 47 | return; |
| 48 | } |
| 49 | |
| 50 | self.data[self.tail] = item; |
| 51 | self.tail += 1; |
| 52 | } |
| 53 | |
| 54 | fn dequeue(&mut self) -> Option<T> { |
| 55 | if self.tail == 0 { |
no outgoing calls