ringbuf

package module
v0.0.0-...-e4cefb5 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

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

func New

func New[E any](cap int) *T[E]

func (*T[E]) Add

func (r *T[E]) Add(e E)

func (*T[E]) AddAndRef

func (r *T[E]) AddAndRef(e E) *E

Add an element and return a pointer to it, that is valid till the next operation on this ringbuffer.

func (*T[E]) All

func (r *T[E]) All() iter.Seq[E]

func (*T[E]) BackRef

func (r *T[E]) BackRef(revidx int) *E

Reference index in the past. 0 current element 1 last element

func (*T[E]) Init

func (r *T[E]) Init(cap int)

func (*T[E]) Len

func (r *T[E]) Len() int

func (*T[E]) Reverse

func (r *T[E]) Reverse() iter.Seq[E]

Jump to

Keyboard shortcuts

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