Documentation ¶
Index ¶
- func Advance[T any](iter Iter[T], count int)
- func AntiJoin[T comparable](a, b []T) []T
- func AntiJoinFn[T any](a, b []T, cmpFn func(a, b T) bool) (r []T)
- func Avg[T constraints.Integer | constraints.Float](a ...T) (r T)
- func Contains[T comparable](vs []T, e T) bool
- func ContainsFn[T any](vs []T, cmpFn CompareFunc[T]) bool
- func Delete[T comparable](set []T, value T) []T
- func Filter[T any](set []T, cmpFn CompareFunc[T]) []T
- func FilterInPlace[T any](set []T, cmpFn CompareFunc[T]) []T
- func Join[T comparable](a, b []T) []T
- func JoinFn[T any](a, b []T, cmpFn func(a, b T) bool) (r []T)
- func Map[T, E any](set []T, fn func(T) E) []E
- func Max[T constraints.Ordered](numbers ...T) (r T)
- func Merge[T comparable](a, b []T) (r []T)
- func MergeFn[T any](cmpFn func(a, b T) bool, a []T, more ...[]T) (r []T)
- func Min[T constraints.Ordered](a, b T) (r T)
- func SearchFn[T any](vs []T, cmpFn CompareFunc[T]) int
- func Sum[T constraints.Integer | constraints.Float](a ...T) (r T)
- type Bytes
- func (b *Bytes) Append(bts ...byte)
- func (b Bytes) Cap() int
- func (b Bytes) Contains(c byte) bool
- func (b *Bytes) CopyFrom(b2 Bytes)
- func (b Bytes) Index(c byte) int
- func (b Bytes) Len() int
- func (b *Bytes) LimitReadFrom(r io.Reader, n int) (int64, error)
- func (b Bytes) LimitWriteTo(w io.Writer, n int) (int64, error)
- func (b *Bytes) Push(bts ...byte)
- func (b Bytes) ReadFrom(r io.Reader) (int64, error)
- func (b *Bytes) Reserve(n int)
- func (b *Bytes) Resize(n int)
- func (b Bytes) Slice(low, max int) Bytes
- func (b Bytes) String() string
- func (b Bytes) UnsafeString() string
- func (b Bytes) WriteTo(w io.Writer) (int64, error)
- type CompareFunc
- type Iter
- type IterBidir
- type IterDrop
- type IterDropBidir
- type List
- func (list *List[T]) Back() (opt OptionalPtr[T])
- func (list *List[T]) Front() (opt OptionalPtr[T])
- func (list *List[T]) Iter() IterDropBidir[T]
- func (list *List[T]) PopBack() (opt OptionalPtr[T])
- func (list *List[T]) PopFront() (opt OptionalPtr[T])
- func (list *List[T]) PushBack(v T) *ListElement[T]
- func (list *List[T]) PushFront(v T) *ListElement[T]
- func (list *List[T]) Reset()
- func (list *List[T]) Size() int
- type ListElement
- type Optional
- type OptionalPtr
- type Pair
- type Queue
- type Ring
- type Tree
- func (tree *Tree[Key, Value]) Data() Optional[Value]
- func (tree *Tree[Key, Value]) Del(path ...Key)
- func (tree *Tree[Key, Value]) Depth() int
- func (tree *Tree[Key, Value]) Fetch(path ...Key) (opt Optional[Value])
- func (tree *Tree[Key, Value]) Get(path ...Key) (depth int, opt Optional[Value])
- func (tree *Tree[Key, Value]) GetTree(path ...Key) *Tree[Key, Value]
- func (tree *Tree[Key, Value]) Name() Key
- func (tree *Tree[Key, Value]) Path() []Key
- func (tree *Tree[Key, Value]) Range(fn func(*Tree[Key, Value]) bool, path ...Key)
- func (tree *Tree[Key, Value]) RangeAll(fn func(*Tree[Key, Value]) bool)
- func (tree *Tree[Key, Value]) RangeLevel(fn func(*Tree[Key, Value]) bool, level int)
- func (tree *Tree[Key, Value]) RangeLimit(fn func(*Tree[Key, Value]) bool, maxDepth int)
- func (tree *Tree[Key, Value]) Set(data Value, path ...Key)
- func (tree *Tree[Key, Value]) SetRange(data Value, lvl int)
- func (tree *Tree[Key, Value]) Trees() []*Tree[Key, Value]
- type Vec
- func (vc *Vec[T]) Append(elmnts ...T)
- func (vc Vec[T]) Back() (opt OptionalPtr[T])
- func (vc Vec[T]) Cap() int
- func (vc Vec[T]) Contains(cmpFn CompareFunc[T]) bool
- func (vc *Vec[T]) DelByIndex(i int) (val T, erased bool)
- func (vc *Vec[T]) Filter(cmpFn CompareFunc[T]) (val T, erased bool)
- func (vc Vec[T]) Front() (opt OptionalPtr[T])
- func (vc Vec[T]) Get(i int) T
- func (vc Vec[T]) Index(cmpFn CompareFunc[T]) int
- func (vc Vec[T]) Len() int
- func (vc *Vec[T]) PopBack() (opt OptionalPtr[T])
- func (vc *Vec[T]) PopFront() (opt OptionalPtr[T])
- func (vc *Vec[T]) Push(elmnts ...T)
- func (vc *Vec[T]) Reserve(n int)
- func (vc *Vec[T]) Resize(n int)
- func (vc Vec[T]) Search(cmpFn CompareFunc[T]) (v T, ok bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AntiJoin ¶
func AntiJoin[T comparable](a, b []T) []T
func AntiJoinFn ¶
func Avg ¶
func Avg[T constraints.Integer | constraints.Float](a ...T) (r T)
func Contains ¶
func Contains[T comparable](vs []T, e T) bool
func ContainsFn ¶
func ContainsFn[T any](vs []T, cmpFn CompareFunc[T]) bool
func Delete ¶
func Delete[T comparable](set []T, value T) []T
func Filter ¶
func Filter[T any](set []T, cmpFn CompareFunc[T]) []T
func FilterInPlace ¶
func FilterInPlace[T any](set []T, cmpFn CompareFunc[T]) []T
func Join ¶
func Join[T comparable](a, b []T) []T
func Max ¶
func Max[T constraints.Ordered](numbers ...T) (r T)
func Merge ¶
func Merge[T comparable](a, b []T) (r []T)
func Min ¶
func Min[T constraints.Ordered](a, b T) (r T)
func SearchFn ¶
func SearchFn[T any](vs []T, cmpFn CompareFunc[T]) int
func Sum ¶
func Sum[T constraints.Integer | constraints.Float](a ...T) (r T)
Types ¶
type Bytes ¶
func (Bytes) LimitWriteTo ¶
LimitWriteTo writes a limited amount from `b` to `w`.
func (Bytes) UnsafeString ¶
type CompareFunc ¶
type IterDropBidir ¶
type List ¶
type List[T any] struct { // contains filtered or unexported fields }
func (*List[T]) Back ¶
func (list *List[T]) Back() (opt OptionalPtr[T])
func (*List[T]) Front ¶
func (list *List[T]) Front() (opt OptionalPtr[T])
func (*List[T]) Iter ¶
func (list *List[T]) Iter() IterDropBidir[T]
func (*List[T]) PopBack ¶
func (list *List[T]) PopBack() (opt OptionalPtr[T])
func (*List[T]) PopFront ¶
func (list *List[T]) PopFront() (opt OptionalPtr[T])
func (*List[T]) PushBack ¶
func (list *List[T]) PushBack(v T) *ListElement[T]
func (*List[T]) PushFront ¶
func (list *List[T]) PushFront(v T) *ListElement[T]
type ListElement ¶
type ListElement[T any] struct { // contains filtered or unexported fields }
func (*ListElement[T]) Drop ¶
func (e *ListElement[T]) Drop()
func (*ListElement[T]) Get ¶
func (e *ListElement[T]) Get() T
func (*ListElement[T]) GetPtr ¶
func (e *ListElement[T]) GetPtr() *T
type Optional ¶
type Optional[T any] struct { // contains filtered or unexported fields }
func MakeOptional ¶
func NewOptional ¶
type OptionalPtr ¶
type OptionalPtr[T any] struct { // contains filtered or unexported fields }
func MakeOptionalPtr ¶
func MakeOptionalPtr[T any](v *T) (opt OptionalPtr[T])
func (OptionalPtr[T]) Get ¶
func (opt OptionalPtr[T]) Get() *T
func (*OptionalPtr[T]) GetValue ¶
func (opt *OptionalPtr[T]) GetValue() T
func (OptionalPtr[T]) HasValue ¶
func (opt OptionalPtr[T]) HasValue() bool
func (OptionalPtr[T]) Or ¶
func (opt OptionalPtr[T]) Or(v *T) OptionalPtr[T]
func (OptionalPtr[T]) Ptr ¶
func (opt OptionalPtr[T]) Ptr() *T
func (*OptionalPtr[T]) Reset ¶
func (opt *OptionalPtr[T]) Reset()
func (*OptionalPtr[T]) Set ¶
func (opt *OptionalPtr[T]) Set(v *T)
type Ring ¶
type Ring[T any] struct { // contains filtered or unexported fields }
Ring is a Multiple-Producer Multiple-Consumer (MPMC) circular buffer data structure.
type Tree ¶
type Tree[Key comparable, Value any] struct { // contains filtered or unexported fields }
func (*Tree[Key, Value]) RangeLevel ¶
func (*Tree[Key, Value]) RangeLimit ¶
type Vec ¶
type Vec[T any] []T
func MakeVecSize ¶
func (Vec[T]) Back ¶
func (vc Vec[T]) Back() (opt OptionalPtr[T])
func (Vec[T]) Contains ¶
func (vc Vec[T]) Contains(cmpFn CompareFunc[T]) bool
func (*Vec[T]) DelByIndex ¶
func (*Vec[T]) Filter ¶
func (vc *Vec[T]) Filter(cmpFn CompareFunc[T]) (val T, erased bool)
func (Vec[T]) Front ¶
func (vc Vec[T]) Front() (opt OptionalPtr[T])
func (Vec[T]) Index ¶
func (vc Vec[T]) Index(cmpFn CompareFunc[T]) int
func (*Vec[T]) PopBack ¶
func (vc *Vec[T]) PopBack() (opt OptionalPtr[T])
func (*Vec[T]) PopFront ¶
func (vc *Vec[T]) PopFront() (opt OptionalPtr[T])
func (Vec[T]) Search ¶
func (vc Vec[T]) Search(cmpFn CompareFunc[T]) (v T, ok bool)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.