constraints

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package constraints provides generic constraints for use with the collection package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparator

type Comparator[T any] interface {
	Compare(T, T) int
}

Comparator is a constraint for a type that can compare two values of type T.

type KeyGenerator added in v0.16.2

type KeyGenerator[T, K any] interface {
	Key(T) K
}

KeyGenerator is a constraint for a type that generates union keys for values of type T.

type Ordered

type Ordered[T any] interface {
	Compare(T) int
}

Ordered is a constraint for types that define their own ordering via a Compare() method.

Jump to

Keyboard shortcuts

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