Documentation
¶
Index ¶
- type Unordered
- func (s *Unordered[T]) Equal(other *Unordered[T]) bool
- func (s *Unordered[T]) Exists(e T) bool
- func (s *Unordered[T]) Insert(e T) bool
- func (s *Unordered[T]) Keys() iter.Seq[T]
- func (s *Unordered[T]) Len() int
- func (s Unordered[T]) LogValue() slog.Value
- func (s *Unordered[T]) Remove(e T) bool
- func (s *Unordered[T]) String() string
- func (s *Unordered[T]) Values() iter.Seq[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Unordered ¶
type Unordered[T comparable] struct { // contains filtered or unexported fields }
func Collect ¶
func Collect[E comparable](seq iter.Seq[E]) (res Unordered[E])
Collect collects values from seq into a new `Unordered` set.
func NewUnordered ¶
func NewUnordered[T comparable](el ...T) (s Unordered[T])
NewUnordered constructs an `Unordered` set from elements. The capacity is set to `2*len(el)`.
func NewUnorderedWithCap ¶
func NewUnorderedWithCap[T comparable](capacity int, el ...T) (s Unordered[T])
NewUnorderedWithCap constructs an `Unordered` set from elements and sets the capacity.
func (*Unordered[T]) Insert ¶
Insert inserts an element into the set and returns `true` if it existed already.
func (*Unordered[T]) Remove ¶
Removes an element `e` from the set and returns `true` if it was removed.
Click to show internal directories.
Click to hide internal directories.