wrap

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapIterator

type MapIterator[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func Map

func Map[K comparable, V any](m map[K]V) *MapIterator[K, V]

func (*MapIterator[K, V]) HasNext

func (i *MapIterator[K, V]) HasNext() bool

func (*MapIterator[K, V]) Next

func (i *MapIterator[K, V]) Next() (K, V)

func (*MapIterator[K, V]) Remove

func (i *MapIterator[K, V]) Remove()

type MapSetIterator

type MapSetIterator[V comparable] struct {
	// contains filtered or unexported fields
}

func MapSet

func MapSet[V comparable](m map[V]struct{}) *MapSetIterator[V]

func (*MapSetIterator[V]) HasNext

func (i *MapSetIterator[V]) HasNext() bool

func (*MapSetIterator[V]) Next

func (i *MapSetIterator[V]) Next() V

func (*MapSetIterator[V]) Remove

func (i *MapSetIterator[V]) Remove()

type SliceWrap

type SliceWrap[V any] struct {
	// contains filtered or unexported fields
}

SliceWrap is a read-only wrapper around a slice, used in cases where you want to use it as a structs.Collection. Attempting to mutate the collection will result in a panic.

func OrderedSlice

func OrderedSlice[V constraints.Ordered](s []V) *SliceWrap[V]

func OrderedValues

func OrderedValues[V constraints.Ordered](values ...V) *SliceWrap[V]

func Slice

func Slice[V any](eq structs.EqualFunc[V], s []V) *SliceWrap[V]

func Values

func Values[V any](eq structs.EqualFunc[V], values ...V) *SliceWrap[V]

func (*SliceWrap[V]) Add

func (s *SliceWrap[V]) Add(value V) bool

func (*SliceWrap[V]) AddAll

func (s *SliceWrap[V]) AddAll(other structs.Collection[V]) bool

func (*SliceWrap[V]) AddIterator

func (s *SliceWrap[V]) AddIterator(iter structs.Iterator[V]) bool

func (*SliceWrap[V]) Clear

func (s *SliceWrap[V]) Clear()

func (*SliceWrap[V]) Contains

func (s *SliceWrap[V]) Contains(value V) bool

func (*SliceWrap[V]) ContainsAll

func (s *SliceWrap[V]) ContainsAll(other structs.Collection[V]) bool

func (*SliceWrap[V]) IsEmpty

func (s *SliceWrap[V]) IsEmpty() bool

func (*SliceWrap[V]) Iterator

func (s *SliceWrap[V]) Iterator() structs.Iterator[V]

func (*SliceWrap[V]) Remove

func (s *SliceWrap[V]) Remove(value V) bool

func (*SliceWrap[V]) RemoveAll

func (s *SliceWrap[V]) RemoveAll(other structs.Collection[V]) bool

func (*SliceWrap[V]) RemoveIterator

func (s *SliceWrap[V]) RemoveIterator(iter structs.Iterator[V]) bool

func (*SliceWrap[V]) RetainAll

func (s *SliceWrap[V]) RetainAll(other structs.Collection[V]) bool

func (*SliceWrap[V]) Size

func (s *SliceWrap[V]) Size() int

func (*SliceWrap[V]) Values

func (s *SliceWrap[V]) Values() []V

type SliceWrapIterator

type SliceWrapIterator[V any] struct {
	// contains filtered or unexported fields
}

func SliceIterator

func SliceIterator[V any](s []V) *SliceWrapIterator[V]

func ValueIterator

func ValueIterator[V any](values ...V) *SliceWrapIterator[V]

func (*SliceWrapIterator[V]) HasNext

func (s *SliceWrapIterator[V]) HasNext() bool

func (*SliceWrapIterator[V]) Next

func (s *SliceWrapIterator[V]) Next() V

func (*SliceWrapIterator[V]) Remove

func (s *SliceWrapIterator[V]) Remove()

Jump to

Keyboard shortcuts

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