containers

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashMap

type HashMap[K comparable, V any] map[K]V

func (HashMap[K, V]) Count

func (c HashMap[K, V]) Count() int

func (HashMap[K, V]) Delete

func (c HashMap[K, V]) Delete(k K) bool

func (HashMap[K, V]) Get

func (c HashMap[K, V]) Get(k K) (V, bool)

func (HashMap[K, V]) Iter

func (c HashMap[K, V]) Iter(f func(K, V) bool)

func (HashMap[K, V]) Put

func (c HashMap[K, V]) Put(k K, v V)

type Map

type Map[K comparable, V any] interface {
	Count() int
	Get(K) (V, bool)
	Put(k K, v V)
	Delete(key K) bool
	Iter(f func(K, V) bool)
}

func NewMap

func NewMap[K comparable, V any](capacity int, swissTable bool) Map[K, V]

Jump to

Keyboard shortcuts

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