bimap

package
v0.0.0-...-157c9c8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bidelete

type Bidelete[A, B comparable] struct {
	A Deleted[A]
	B Deleted[B]
}

type Bimap

type Bimap[A, B comparable] struct {
	// contains filtered or unexported fields
}

func New

func New[A, B comparable](size int) *Bimap[A, B]

func (*Bimap[A, B]) A

func (bi *Bimap[A, B]) A(a A) (b B, found bool)

func (*Bimap[A, B]) Add

func (bi *Bimap[A, B]) Add(a A, b B) (bd Bidelete[A, B])

func (*Bimap[A, B]) B

func (bi *Bimap[A, B]) B(b B) (a A, found bool)

func (*Bimap[A, B]) DeleteA

func (bi *Bimap[A, B]) DeleteA(a A) (d Deleted[B])

func (*Bimap[A, B]) DeleteB

func (bi *Bimap[A, B]) DeleteB(b B) (d Deleted[A])

func (*Bimap[A, B]) Each

func (bi *Bimap[A, B]) Each(fn func(a A, b B) bool)

type Deleted

type Deleted[X comparable] struct {
	Value   X
	Deleted bool
}

Jump to

Keyboard shortcuts

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