Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T any] []T
Queue implements a FIFO queue.
func (*Queue[T]) Dequeue ¶
Dequeue removes a single element from the front of the queue (if there is one) and returns it. Returns a zero value and false if there is no element to dequeue.
func (*Queue[T]) DequeueN ¶
DequeueN removes N elements from the front of the queue (if there are enough) and returns a slice of those elements. Returns a nil slice and false if there are insufficient elements to dequeue.
func (*Queue[T]) Enqueue ¶
func (q *Queue[T]) Enqueue(t ...T)
Enqueue adds the elements to the back of the queue.
func (*Queue[T]) Peek ¶
Peek returns the single element at the front of the queue (if there is one) without removing it. Returns a zero value and false if there is no element to peek at.
Click to show internal directories.
Click to hide internal directories.