Documentation ¶
Index ¶
- type HashedSet
- func (s *HashedSet[K, T]) Add(vs ...T)
- func (s HashedSet[K, T]) Contains(v T) bool
- func (s HashedSet[K, T]) ContainsAll(vs ...T) bool
- func (s HashedSet[K, T]) ContainsAny(vs ...T) bool
- func (s HashedSet[K, T]) Intersection(other HashedSet[K, T]) HashedSet[K, T]
- func (s HashedSet[K, T]) Len() int
- func (s HashedSet[K, T]) MarshalYAML() (interface{}, error)
- func (s *HashedSet[K, T]) Remove(v T) bool
- func (s HashedSet[K, T]) ToMap() map[K]T
- func (s HashedSet[K, T]) ToSlice() []T
- func (s HashedSet[K, T]) Union(other HashedSet[K, T]) HashedSet[K, T]
- func (s *HashedSet[K, T]) UnmarshalYAML(node *yaml.Node) error
- type Set
- func (s Set[T]) Add(vs ...T)
- func (s Set[T]) AddFrom(other Set[T])
- func (s Set[T]) Contains(v T) bool
- func (s Set[T]) ContainsAll(vs ...T) bool
- func (s Set[T]) ContainsAny(vs ...T) bool
- func (s Set[T]) Difference(other Set[T]) Set[T]
- func (s Set[T]) Intersection(other Set[T]) Set[T]
- func (s Set[T]) Len() int
- func (s Set[T]) Remove(v T) bool
- func (s Set[T]) String() string
- func (s Set[T]) ToSlice() []T
- func (s Set[T]) Union(other Set[T]) Set[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashedSet ¶
type HashedSet[K comparable, T any] struct { Hasher func(T) K M map[K]T // Less is used to sort the keys of the set when converting to a slice. // If Less is nil, the keys will be sorted in an arbitrary order according to [map] iteration. Less func(K, K) bool }
func HashedSetOf ¶
func HashedSetOf[K comparable, T any](hasher func(T) K, vs ...T) HashedSet[K, T]
func (HashedSet[K, T]) ContainsAll ¶
func (HashedSet[K, T]) ContainsAny ¶
func (HashedSet[K, T]) Intersection ¶
func (HashedSet[K, T]) MarshalYAML ¶
func (*HashedSet[K, T]) UnmarshalYAML ¶
type Set ¶
type Set[T comparable] map[T]struct{}
func SetOf ¶
func SetOf[T comparable](vs ...T) Set[T]
func (Set[T]) ContainsAll ¶
func (Set[T]) ContainsAny ¶
func (Set[T]) Difference ¶
func (Set[T]) Intersection ¶
Click to show internal directories.
Click to hide internal directories.