collection

package
v0.0.0-...-883d5d7 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set[T comparable] map[T]struct{}

Set holds a set of values.

func NewSet

func NewSet[T comparable](values ...T) Set[T]

NewSet creates a new set from its input values.

func (Set[T]) Add

func (s Set[T]) Add(values ...T)

Add values to the set.

func (*Set[T]) Clear

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

Clear the set.

func (Set[T]) Clone

func (s Set[T]) Clone() Set[T]

Clone returns a copy of the set.

func (Set[T]) Contains

func (s Set[T]) Contains(value T) bool

Contains returns true if the value exists within the set.

func (Set[T]) Empty

func (s Set[T]) Empty() bool

Empty returns true if there are no values in the set.

func (Set[T]) Len

func (s Set[T]) Len() int

Len returns the number of values in the set.

func (Set[T]) Values

func (s Set[T]) Values() []T

Values returns all values in the set.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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