ringqueue

package
v1.12.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RingQueue

type RingQueue[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](capacity int) *RingQueue[T]

func (*RingQueue[T]) Capacity

func (q *RingQueue[T]) Capacity() int

func (*RingQueue[T]) Dequeue

func (q *RingQueue[T]) Dequeue() (T, bool)

func (*RingQueue[T]) Enqueue

func (q *RingQueue[T]) Enqueue(value T) bool

func (*RingQueue[T]) Front

func (q *RingQueue[T]) Front() (T, bool)

func (*RingQueue[T]) IsFull

func (q *RingQueue[T]) IsFull() bool

IsFull checks if the ring buffer is full

func (*RingQueue[T]) Length

func (q *RingQueue[T]) Length() int

func (*RingQueue[T]) LookAll

func (q *RingQueue[T]) LookAll() []T

LookAll reads all elements from ring buffer this method doesn't consume all elements

func (*RingQueue[T]) Tail

func (q *RingQueue[T]) Tail() (T, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL