kv

package
v2.0.0-...-cfe7cf8 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal[K any, V any](a, b KeyValue[K, V]) bool

Equal returns true iff a == b. If a or b implements Equatable, that is used to perform the test.

func KeyEqual

func KeyEqual[K any, V any](a, b KeyValue[K, V]) bool

func KeyValueEqual

func KeyValueEqual[K, V any](a, b KeyValue[K, V]) bool

Types

type Equatable

type Equatable[K any, V any] interface {
	Equal(KeyValue[K, V]) bool
}

Equatable represents a type that can be compared for equality with another value.

type KeyValue

type KeyValue[K any, V any] struct {
	Key   K
	Value V
}

KeyValue[K, V] represents a key-value pair for insertion into a Map.

func KV

func KV[K any, V any](key K, val V) KeyValue[K, V]

KV creates a KeyValue[K, V].

func (KeyValue[K, V]) Equal

func (kv KeyValue[K, V]) Equal(kv2 KeyValue[K, V]) bool

func (KeyValue[K, V]) Format

func (kv KeyValue[K, V]) Format(f fmt.State, verb rune)

String returns a string representation of a KeyValue[K, V].

func (KeyValue[K, V]) Hash

func (kv KeyValue[K, V]) Hash(seed uintptr) uintptr

Hash computes a hash for a KeyValue[K, V].

func (KeyValue[K, V]) String

func (kv KeyValue[K, V]) String() string

String returns a string representation of a KeyValue[K, V].

Jump to

Keyboard shortcuts

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