Documentation
¶
Index ¶
- type Builder
- func (b *Builder[T]) Append(elem ...T) *Builder[T]
- func (b *Builder[T]) AppendSeq(seq iter.Seq[T]) *Builder[T]
- func (b *Builder[T]) AppendSeq2(seq iter.Seq2[int, T]) *Builder[T]
- func (b *Builder[T]) AppendSlice(other Slice[T]) *Builder[T]
- func (b *Builder[T]) Cap() int
- func (b *Builder[T]) Grow(n int) *Builder[T]
- func (b *Builder[T]) Len() int
- func (b *Builder[T]) Reverse() *Builder[T]
- func (b *Builder[T]) Seal() Slice[T]
- func (b *Builder[T]) Sort(cmp func(a, b T) int) *Builder[T]
- type Map
- type Mapper
- func (m *Mapper[K, V]) Collect(seq iter.Seq2[K, V]) *Mapper[K, V]
- func (m *Mapper[K, V]) Copy(src map[K]V) *Mapper[K, V]
- func (m *Mapper[K, V]) CopyMap(other Map[K, V]) *Mapper[K, V]
- func (m *Mapper[K, V]) Len() int
- func (m *Mapper[K, V]) Put(k K, v V) *Mapper[K, V]
- func (m *Mapper[K, V]) Seal() Map[K, V]
- type Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder[T any] struct { // contains filtered or unexported fields }
Builder is a write-only data structure used to create sealed Slices. The zero builder is valid, but a nil builder is not valid and will trigger panics if any method is invoked.
func NewBuilder ¶
func (*Builder[T]) AppendSeq ¶
AppendSeq appends all values from an iter.Seq and returns the builder.
If you know the number of elements in the seq it is usually worthwhile calling Grow before calling AppendSeq2, or ensure that the builder is created with enough initial capacity when calling NewBuilder.
func (*Builder[T]) AppendSeq2 ¶
AppendSeq2 appends all values from an iter.Seq2 and returns the builder.
If you know the number of elements in the seq it is usually worthwhile calling Grow before calling AppendSeq2, or ensure that the builder is created with enough initial capacity when calling NewBuilder.
func (*Builder[T]) AppendSlice ¶
func (*Builder[T]) Grow ¶
Grow ensures there is underlying capacity for appending another n elements without allocations.
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
type Mapper ¶
type Mapper[K comparable, V any] struct { // contains filtered or unexported fields }
type Slice ¶
type Slice[T any] struct { // contains filtered or unexported fields }
Slice is an immutable representation of a standard Go slice. Use Builder.Seal to create a new slice. The zero-value of Slice is a valid representation of an empty slice.