utils

package
v0.0.0-...-b7dbd64 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool[T any] struct {
	New     func() T
	Prepare func(v T) T
	// contains filtered or unexported fields
}

Pool is a generic wrapped over sync.Pool, that also allows for a prepare function to be called on the value before it is returned.

func (*Pool[T]) Get

func (p *Pool[T]) Get() T

func (*Pool[T]) Put

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

type SortedSet

type SortedSet[T cmp.Ordered] struct {
	// contains filtered or unexported fields
}

SortedSet is a set of ordered elements. Writes are not concurrent-safe.

func (*SortedSet[T]) Add

func (s *SortedSet[T]) Add(v T)

func (*SortedSet[T]) All

func (s *SortedSet[T]) All() []T

func (*SortedSet[T]) Clear

func (s *SortedSet[T]) Clear()

func (*SortedSet[T]) Contains

func (s *SortedSet[T]) Contains(v T) bool

func (*SortedSet[T]) Remove

func (s *SortedSet[T]) Remove(v T)

Jump to

Keyboard shortcuts

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