Documentation ¶
Index ¶
- type Iterator
- type Wrapper
- func (w *Wrapper[T]) Add(value T)
- func (w *Wrapper[T]) Clear()
- func (w *Wrapper[T]) Clone() sets.Set[T]
- func (w *Wrapper[T]) Contains(value T) bool
- func (w *Wrapper[T]) Iterator() iter.Iterator[T]
- func (w *Wrapper[T]) Remove(value T)
- func (w *Wrapper[T]) SetIterator() sets.Iterator[T]
- func (w *Wrapper[T]) Size() int
- func (w *Wrapper[T]) Stream(yield func(T) bool)
- func (w *Wrapper[T]) Transaction(updateFunction func(set sets.Set[T]))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iterator ¶
type Iterator[T any] struct { // contains filtered or unexported fields }
Iterator is a wrapper around an iterator that provides thread-safe access to the underlying collection.
type Wrapper ¶
type Wrapper[T any] struct { // contains filtered or unexported fields }
Wrapper is a wrapper around a set that provides thread-safe access to the set. Locking is done through read-write mutex. This means that multiple goroutines can read from the set at the same time, but only one goroutine can write to the set at the same time.
func (*Wrapper[T]) Remove ¶
func (w *Wrapper[T]) Remove(value T)
Remove removes the given value from the set.
func (*Wrapper[T]) SetIterator ¶
SetIterator returns an iterator over the elements in the set.
func (*Wrapper[T]) Transaction ¶
Transaction executes the given update function with the set as an argument. The set is locked for writing during the execution of the update function.
Click to show internal directories.
Click to hide internal directories.