immutable_map

package
v0.0.0-...-b6e66c0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToGoMap

func ToGoMap[Key comparable, Value any](m *Map[Key, Value]) map[Key]Value

Types

type Map

type Map[Key any, Value any] immutable_rb_tree.RBTree[tuple.KeyValuePair[Key, Value]]

func FromGoMap

func FromGoMap[Key comparable, Value any](cmp comparator.Comparator[Key], goMap map[Key]Value) *Map[Key, Value]

func FromKeyValuePairs

func FromKeyValuePairs[Key any, Value any](cmp comparator.Comparator[Key], kvPairs ...tuple.KeyValuePair[Key, Value]) *Map[Key, Value]

func New

func New[Key any, Value any](cmp comparator.Comparator[Key]) *Map[Key, Value]

func (*Map[Key, Value]) All

func (m *Map[Key, Value]) All() iter.Seq2[Key, Value]

func (*Map[Key, Value]) Count

func (m *Map[Key, Value]) Count() int

func (*Map[Key, Value]) Delete

func (m *Map[Key, Value]) Delete(key Key) (newMap *Map[Key, Value], affected bool)

func (*Map[Key, Value]) Empty

func (m *Map[Key, Value]) Empty() bool

func (*Map[Key, Value]) Index

func (m *Map[Key, Value]) Index(key Key) (value Value, has bool)

func (*Map[Key, Value]) Insert

func (m *Map[Key, Value]) Insert(key Key, value Value) (newMap *Map[Key, Value], affected bool)

func (*Map[Key, Value]) KeyValuePairs

func (m *Map[Key, Value]) KeyValuePairs() []tuple.KeyValuePair[Key, Value]

Jump to

Keyboard shortcuts

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