Documentation
¶
Index ¶
- type Set
- func (s *Set[T]) Add(v T) bool
- func (s *Set[T]) Append(v ...T) int
- func (s *Set[T]) Clear()
- func (s *Set[T]) Clone() container.Set[T]
- func (s *Set[T]) Contains(v ...T) bool
- func (s *Set[T]) ContainsAny(v ...T) bool
- func (s *Set[T]) ContainsAnyElement(other container.Set[T]) bool
- func (s *Set[T]) ContainsOne(v T) bool
- func (s *Set[T]) Difference(other container.Set[T]) container.Set[T]
- func (s *Set[T]) Each(cb func(T) bool)
- func (s *Set[T]) Equal(other container.Set[T]) bool
- func (s *Set[T]) Intersect(other container.Set[T]) container.Set[T]
- func (s *Set[T]) IsEmpty() bool
- func (s *Set[T]) IsProperSubset(other container.Set[T]) bool
- func (s *Set[T]) IsProperSuperset(other container.Set[T]) bool
- func (s *Set[T]) IsSubset(other container.Set[T]) bool
- func (s *Set[T]) IsSuperset(other container.Set[T]) bool
- func (s *Set[T]) Iter() iter.Seq[T]
- func (s *Set[T]) Len() int
- func (s Set[T]) MarshalJSON() ([]byte, error)
- func (s *Set[T]) Pop() (v T, ok bool)
- func (s Set[T]) Remove(v T)
- func (s Set[T]) RemoveAll(i ...T)
- func (s Set[T]) String() string
- func (s *Set[T]) SymmetricDifference(other container.Set[T]) container.Set[T]
- func (s Set[T]) ToSlice() []T
- func (s Set[T]) Union(other container.Set[T]) container.Set[T]
- func (s *Set[T]) UnmarshalJSON(b []byte) error
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{}
func New ¶
func New[T comparable](vals ...T) *Set[T]
func NewWith ¶ added in v0.2.2
func NewWith[T comparable](cardinality int, vals ...T) *Set[T]
func (*Set[T]) ContainsAny ¶ added in v0.2.2
func (*Set[T]) ContainsAnyElement ¶ added in v0.2.2
func (*Set[T]) ContainsOne ¶ added in v0.2.2
func (*Set[T]) IsProperSubset ¶ added in v0.2.2
func (*Set[T]) IsProperSuperset ¶ added in v0.2.2
func (*Set[T]) IsSuperset ¶ added in v0.2.2
func (*Set[T]) Iter ¶ added in v0.2.2
Iter returns an iterator over all elements in the set in sorted order.
func (Set[T]) MarshalJSON ¶
func (*Set[T]) SymmetricDifference ¶ added in v0.2.2
func (*Set[T]) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.