set

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 2 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] struct {
	// contains filtered or unexported fields
}

func New

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

func NewFrom

func NewFrom[T comparable](inputs []T) *Set[T]

func (*Set[T]) Add

func (h *Set[T]) Add(item T)

func (*Set[T]) Clear

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

func (*Set[T]) Count

func (h *Set[T]) Count() int

func (*Set[T]) Has

func (h *Set[T]) Has(item T) bool

func (*Set[T]) Items

func (h *Set[T]) Items() []T

func (*Set[T]) Remove

func (h *Set[T]) Remove(item T)

type SyncSet

type SyncSet[T comparable] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSync

func NewSync[T comparable]() *SyncSet[T]

func NewSyncFrom

func NewSyncFrom[T comparable](inputs []T) *SyncSet[T]

func (*SyncSet[T]) Add

func (h *SyncSet[T]) Add(item T)

func (*SyncSet[T]) Clear

func (h *SyncSet[T]) Clear()

func (*SyncSet[T]) Count

func (h *SyncSet[T]) Count() int

func (*SyncSet[T]) Has

func (h *SyncSet[T]) Has(item T) bool

func (*SyncSet[T]) Items

func (h *SyncSet[T]) Items() []T

func (*SyncSet[T]) Remove

func (h *SyncSet[T]) Remove(item T)

Jump to

Keyboard shortcuts

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