interfaces

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Numeric

func Numeric[N Number](n N) bool

Numeric returns false if n is Inf/NaN.

Always returns true for integral values.

Types

type ContainsFunc added in v0.4.0

type ContainsFunc[T any] interface {
	Contains(T) bool
}

The ContainsFunc interface is satisfied by a type that implements Contains(T).

type CopyEqual added in v0.6.2

type CopyEqual[T any] interface {
	EqualFunc[T]
	CopyFunc[T]
}

CopyEqual represents a type satisfying both EqualFunc and CopyFunc.

type CopyFunc added in v0.6.2

type CopyFunc[A any] interface {
	Copy() A
}

CopyFunc represents a type implementing the Copy method.

type EmptyFunc added in v0.4.0

type EmptyFunc interface {
	Empty() bool
}

The EmptyFunc interface is satisfied by a type that implements Empty().

type EqualFunc added in v0.4.0

type EqualFunc[A any] interface {
	Equal(A) bool
}

EqualFunc represents a type implementing the Equal method.

type LengthFunc added in v0.4.0

type LengthFunc interface {
	Len() int
}

The LengthFunc interface is satisfied by a type that implements Len().

type LessFunc

type LessFunc[A any] interface {
	Less(A) bool
}

LessFunc represents any type implementing the Less method.

type Map

type Map[K comparable, V any] interface {
	~map[K]V
}

Map represents any map type where keys are comparable.

type MapEqualFunc added in v0.4.0

type MapEqualFunc[K comparable, V EqualFunc[V]] interface {
	~map[K]V
}

MapEqualFunc represents any map type where keys are comparable and values implement .Equal method.

type MaxFunc added in v0.6.3

type MaxFunc[T any] interface {
	Max() T
}

MaxFunc represents a type implementing the Max method.

type MinFunc added in v0.6.3

type MinFunc[T any] interface {
	Min() T
}

MinFunc represents a type implementing the Min method.

type Number

Number is float, integer, or complex.

type SizeFunc added in v0.4.0

type SizeFunc interface {
	Size() int
}

The SizeFunc interface is satisfied by a type that implements Size().

type TweakFunc added in v0.6.2

type TweakFunc[E CopyEqual[E]] func(E)

TweakFunc is used for modifying a value in tests.

Jump to

Keyboard shortcuts

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