/// Push an item onto the end of the queue.
///
/// Will insert the new item, but will not update the bounds in storage.
Push an item onto the end of the queue.
Will insert the new item, but will not update the bounds in storage.
Push an item onto the end of the queue . Will insert the new item but will not update the bounds in storage .
fn push(&mut self, item: Item) {
		M::insert(self.end, item);
		// this will intentionally overflow and wrap around when bonds_end
		// reaches `Index::max_value` because we want a ringbuffer.
		let next_index = self.end.wrapping_add(1.into());
		if next_index == self.start {
			// queue presents as empty but is not
			// --> overwrite the oldest item in the FIFO ringbuffer
			self.start = self.start.wrapping_add(1.into());
		}
		self.end = next_index;
	}
fn push ( & mut self , item : Item ) { M :: insert ( self . end , item ) ; // this will intentionally overflow and wrap around when bonds_end // reaches `Index::max_value` because we want a ringbuffer. let next_index = self . end . wrapping_add ( 1 . into ( ) ) ; if next_index == self . start { // queue presents as empty but is not // --> overwrite the oldest item in the FIFO ringbuffer self . start = self . start . wrapping_add ( 1 . into ( ) ) ; } self . end = next_index ; }
Push an item onto the end of the queue.
Push an item onto the end of the queue .
&mut self
item
Item