Documentation
¶
Index ¶
- func CollectWithError[T any](seq iter.Seq2[T, error]) (res []T, _ error)
- func Filter[T any](seq iter.Seq[T], predicate func(T) bool) iter.Seq[T]
- func Filter2[T any, U any](seq iter.Seq2[T, U], predicate func(T, U) bool) iter.Seq2[T, U]
- func FilterE[T any](seq iter.Seq2[T, error], predicate func(T) (bool, error)) iter.Seq2[T, error]
- func NilablePtr[T comparable](v T) *T
- func Ptr[T any](v T) *T
- func Remap[S comparable, V any](v *V, m map[S]V, s S) error
- func WithError[T any](seq iter.Seq[T], err error) iter.Seq2[T, error]
- func WithNilError[T any](seq iter.Seq[T]) iter.Seq2[T, error]
- type Map
- type Set
- func (s *Set[T, U]) Add(item U) (added bool)
- func (s *Set[T, U]) At(i int) U
- func (s *Set[T, U]) Clear()
- func (s *Set[T, U]) GetByID(id T) (U, bool)
- func (s *Set[T, U]) Has(item U) bool
- func (s *Set[T, U]) HasID(id T) bool
- func (s *Set[T, U]) Iter() iter.Seq[U]
- func (s *Set[T, U]) Len() int
- func (s *Set[T, U]) List() []U
- func (s *Set[T, U]) Remove(item U) (removed bool)
- func (s *Set[T, U]) RemoveByID(id T) (removed bool)
- func (s *Set[T, U]) Set(item U) (updated bool)
- type Tristate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectWithError ¶ added in v4.0.2
CollectWithError is a function that collects items from a iter.Seq2 with an error into a slice, returning an error if any.
func FilterE ¶ added in v4.0.2
FilterE is a function that filters a iter.Seq2 with an error based on a predicate.
func NilablePtr ¶
func NilablePtr[T comparable](v T) *T
func Remap ¶
func Remap[S comparable, V any](v *V, m map[S]V, s S) error
Types ¶
type Map ¶
type Map[TKey comparable, TVal any] map[TKey]TVal
type Set ¶ added in v4.0.2
type Set[T comparable, U interface{ ID() T }] struct { // contains filtered or unexported fields }
func NewSet ¶ added in v4.0.2
func NewSet[T comparable, U interface{ ID() T }](sources ...U) *Set[T, U]
func (*Set[T, U]) RemoveByID ¶ added in v4.0.2
Click to show internal directories.
Click to hide internal directories.