Documentation
¶
Index ¶
- type Queue
- func (q *Queue[T]) Cap() int
- func (q *Queue[T]) Clear() iter.Seq[T]
- func (q *Queue[T]) DeleteFunc(shouldRemove func(T) bool) (removed iter.Seq[T])
- func (q *Queue[T]) IsEmpty() bool
- func (q *Queue[T]) IsFull() bool
- func (q *Queue[T]) Len() int
- func (q *Queue[T]) Pull() (value T, ok bool)
- func (q *Queue[T]) Push(value T) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
Queue is a bounded FIFO queue implemented using a circular array. It uses head and tail pointers to avoid slice re-allocations. When full, new elements are rejected rather than overwriting old ones.
func (*Queue[T]) Clear ¶
Clear removes all elements from the queue. Returns an iterator over the removed elements.
func (*Queue[T]) DeleteFunc ¶
DeleteFunc removes elements from the queue based on a predicate function. Returns an iterator over the removed elements. Elements for which shouldRemove returns true are removed from the queue.
Click to show internal directories.
Click to hide internal directories.