unique

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package unique implements the upstream Go unique package for TinyGo.

It is not a full implementation: while it should behave the same way, it doesn't free unreferenced uniqued objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handle

type Handle[T comparable] struct {
	// contains filtered or unexported fields
}

Unique handle for the given value. Comparing two handles is cheap.

func Make

func Make[T comparable](value T) Handle[T]

Make a new unqique handle for the given value.

func (Handle[T]) Value

func (h Handle[T]) Value() T

Value returns a shallow copy of the T value that produced the Handle.

Jump to

Keyboard shortcuts

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