set

package
v1.34.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: BSD-3-Clause Imports: 0 Imported by: 34

Documentation

Overview

Package set contains set types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handle

type Handle struct {
	// contains filtered or unexported fields
}

Handle is a opaque comparable value that's used as the map key in a HandleSet. The only way to get one is to call HandleSet.Add.

type HandleSet

type HandleSet[T any] map[Handle]T

HandleSet is a set of T.

It is not safe for concurrent use.

func (*HandleSet[T]) Add

func (s *HandleSet[T]) Add(e T) Handle

Add adds the element (map value) e to the set.

It returns the handle (map key) with which e can be removed, using a map delete.

Jump to

Keyboard shortcuts

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