Documentation
¶
Index ¶
- func Append[T comparable](b []byte, x T) ([]byte, error)
- func AppendBool(b []byte, x bool) []byte
- func AppendComplex128(b []byte, x complex128) []byte
- func AppendComplex64(b []byte, x complex64) []byte
- func AppendFloat32(b []byte, x float32) []byte
- func AppendFloat64(b []byte, x float64) []byte
- func AppendInt(b []byte, x int) []byte
- func AppendInt16(b []byte, x int16) []byte
- func AppendInt32(b []byte, x int32) []byte
- func AppendInt64(b []byte, x int64) []byte
- func AppendInt8(b []byte, x int8) []byte
- func AppendMap[K comparable, V comparable, T ~map[K]V](b []byte, m T) ([]byte, error)
- func AppendPair[T0, T1 comparable](b []byte, x Pair[T0, T1]) ([]byte, error)
- func AppendSeq[T0 comparable](b []byte, seq iter.Seq[T0]) ([]byte, error)
- func AppendSeq2[T0, T1 comparable](b []byte, seq iter.Seq2[T0, T1]) ([]byte, error)
- func AppendSlice[E comparable, T ~[]E](b []byte, x T) ([]byte, error)
- func AppendSortedMap[K comparable, V comparable, T ~map[K]V](b []byte, m T) ([]byte, error)
- func AppendSpan[T comparable](b []byte, x T) ([]byte, error)
- func AppendStruct[T comparable](b []byte, x T) ([]byte, error)
- func AppendTriple[T0, T1, T2 comparable](b []byte, x Triple[T0, T1, T2]) ([]byte, error)
- func AppendUint(b []byte, x uint) []byte
- func AppendUint16(b []byte, x uint16) []byte
- func AppendUint32(b []byte, x uint32) []byte
- func AppendUint64(b []byte, x uint64) []byte
- func AppendUint8(b []byte, x uint8) []byte
- func AppendUvarint(b []byte, x uint64) []byte
- func AppendVarint(b []byte, x int64) []byte
- func IsFixed[T any](x any) bool
- func Size[T any](e T) int
- func SizeFixed[T comparable](x T) (int, bool)
- func SizeMap[K comparable, V comparable, T ~map[K]V](m T) int
- func SizeSlice[E comparable, T ~[]E](x T) int
- func SizeUvarint(x uint64) int
- func SizeVarint(x int64) int
- func SortMultiTable[K, V cmp.Ordered](table []OrderedPair[K, V])
- func SortMultiTableFunc[K, V cmp.Ordered](table []OrderedPair[K, V], cmp func(a, b OrderedPair[K, V]) int)
- func SortTable[K cmp.Ordered, V comparable](table []PartialOrderedPair[K, V])
- func SortTableFunc[K cmp.Ordered, V comparable](table []PartialOrderedPair[K, V], cmp func(a, b K) int)
- func SpanSeq[E comparable](x iter.Seq[E]) iter.Seq[Span[E]]
- func SpanSeqSlice[E comparable, T ~[]E](x T) iter.Seq[Span[E]]
- type OrderedPair
- type Pair
- type PartialOrderedPair
- type Span
- type Triple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendBool ¶
func AppendComplex128 ¶
func AppendComplex128(b []byte, x complex128) []byte
func AppendComplex64 ¶
func AppendFloat32 ¶
func AppendFloat64 ¶
func AppendInt16 ¶
func AppendInt32 ¶
func AppendInt64 ¶
func AppendInt8 ¶
func AppendMap ¶
func AppendMap[K comparable, V comparable, T ~map[K]V](b []byte, m T) ([]byte, error)
func AppendPair ¶
func AppendPair[T0, T1 comparable](b []byte, x Pair[T0, T1]) ([]byte, error)
func AppendSeq2 ¶
func AppendSlice ¶
func AppendSlice[E comparable, T ~[]E](b []byte, x T) ([]byte, error)
func AppendSortedMap ¶
func AppendSortedMap[K comparable, V comparable, T ~map[K]V](b []byte, m T) ([]byte, error)
func AppendSpan ¶
func AppendSpan[T comparable](b []byte, x T) ([]byte, error)
func AppendStruct ¶
func AppendStruct[T comparable](b []byte, x T) ([]byte, error)
func AppendTriple ¶
func AppendTriple[T0, T1, T2 comparable](b []byte, x Triple[T0, T1, T2]) ([]byte, error)
func AppendUint ¶
func AppendUint16 ¶
func AppendUint32 ¶
func AppendUint64 ¶
func AppendUint8 ¶
func AppendUvarint ¶
func AppendVarint ¶
func SizeFixed ¶
func SizeFixed[T comparable](x T) (int, bool)
func SizeMap ¶
func SizeMap[K comparable, V comparable, T ~map[K]V](m T) int
func SizeSlice ¶
func SizeSlice[E comparable, T ~[]E](x T) int
func SizeUvarint ¶
func SizeVarint ¶
func SortMultiTable ¶
func SortMultiTable[K, V cmp.Ordered](table []OrderedPair[K, V])
Sort the multi mapped table based on the given cmp function which may implement multimap sorting.
func SortMultiTableFunc ¶
func SortMultiTableFunc[K, V cmp.Ordered](table []OrderedPair[K, V], cmp func(a, b OrderedPair[K, V]) int)
Sort the multi mapped table based on the given cmp function which may implement multimap sorting.
func SortTable ¶
func SortTable[K cmp.Ordered, V comparable](table []PartialOrderedPair[K, V])
SortTable sorts the table based on the given cmp function which may implement multimap sorting.
func SortTableFunc ¶
func SortTableFunc[K cmp.Ordered, V comparable](table []PartialOrderedPair[K, V], cmp func(a, b K) int)
SortTableFunc sorts the table based on the given cmp function which may implement multimap sorting.
func SpanSeqSlice ¶
func SpanSeqSlice[E comparable, T ~[]E](x T) iter.Seq[Span[E]]
Types ¶
type OrderedPair ¶
func CompactMultiTable ¶
func CompactMultiTable[K, V cmp.Ordered](table []OrderedPair[K, V]) []OrderedPair[K, V]
CompactMultiTable sorts the table entries and compacts equal keys and values.
CompactMultiTable removes duplicate (K, V) entries.
func CompactMultiTableFunc ¶
func CompactMultiTableFunc[K, V cmp.Ordered](t []OrderedPair[K, V], cmp func(a, b OrderedPair[K, V]) int) []OrderedPair[K, V]
CompactMultiTableFunc sorts the table entries and compacts equal keys and values.
CompactMultiTableFunc removes duplicate (K, V) entries.
type Pair ¶
type Pair[T0, T1 comparable] struct { E0 T0 E1 T1 }
func AppendPairs ¶
func AppendPairs[T0, T1 comparable](pairs []Pair[T0, T1], seq iter.Seq2[T0, T1]) []Pair[T0, T1]
func CollectPairs ¶
func CollectPairs[T0, T1 comparable](seq iter.Seq2[T0, T1]) []Pair[T0, T1]
type PartialOrderedPair ¶
type PartialOrderedPair[T0 cmp.Ordered, T1 comparable] struct { E0 T0 E1 T1 }
func CompactTable ¶
func CompactTable[K cmp.Ordered, V comparable](table []PartialOrderedPair[K, V]) []PartialOrderedPair[K, V]
CompactTable sorts the table entries and compacts equal keys.
CompactTable removes multiple values for the same key, only keeping the first.
func CompactTableFunc ¶
func CompactTableFunc[K cmp.Ordered, V comparable](table []PartialOrderedPair[K, V], cmp func(a, b K) int) []PartialOrderedPair[K, V]
CompactTableFunc sorts the table entries and compacts equal keys.
CompactTableFunc removes multiple values for the same key, only keeping the first.
type Span ¶
type Span[E comparable] struct{ E E }
type Triple ¶
type Triple[T0, T1, T2 comparable] struct { E0 T0 E1 T1 E2 T2 }