tuple

package module
v0.0.0-...-f1613a7 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 1970 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package tuple provides an 3-ary tuple implementation. This is useful for cases where multiple values should be grouped together, such as for passing across channels. Multiple returns and n-ary tuples may be converted between as well by using the 'New' method to go from n-ary return to a Tuple, and using Tuple.Unpack to convert in the other direction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tuple

type Tuple[T0, T1, T2 any] struct {
	T0 T0
	T1 T1
	T2 T2
}

Tuple implements an 3-ary generic tuple. It may be used

func New

func New[T0, T1, T2 any](t0 T0, t1 T1, t2 T2) Tuple[T0, T1, T2]

New constructs a new tuple from the given arguments.

func (Tuple[T0, T1, T2]) Unpack

func (t Tuple[T0, T1, T2]) Unpack() (T0, T1, T2)

Unpack unpacks a Tuple via multiple-return of the contained data.

Jump to

Keyboard shortcuts

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