pool

package
v0.34.9 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: GPL-3.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool[T comparable] struct {
	// contains filtered or unexported fields
}

func New

func New[T comparable]() *Pool[T]

func (*Pool[T]) Add

func (p *Pool[T]) Add(v T)

func (*Pool[T]) Clear

func (p *Pool[T]) Clear(clean func(T))

func (*Pool[T]) Dequeue

func (p *Pool[T]) Dequeue() (v T, ok bool)

func (*Pool[T]) Front

func (p *Pool[T]) Front() (v T, ok bool)

func (*Pool[T]) Has added in v0.30.6

func (p *Pool[T]) Has(v T) bool

func (*Pool[T]) Next

func (p *Pool[T]) Next() (v T, ok bool)

func (*Pool[T]) Peek

func (p *Pool[T]) Peek() (v T, ok bool)

func (*Pool[T]) Pop

func (p *Pool[T]) Pop() (v T, ok bool)

func (*Pool[T]) Push

func (p *Pool[T]) Push(v T)

func (*Pool[T]) Random

func (p *Pool[T]) Random() (v T, ok bool)

func (*Pool[T]) Range

func (p *Pool[T]) Range(fn func(T) bool)

func (*Pool[T]) Remove

func (p *Pool[T]) Remove(v T)

func (*Pool[T]) Size

func (p *Pool[T]) Size() int

Jump to

Keyboard shortcuts

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