Documentation ¶
Overview ¶
Package ucontainer extends container and implements generic container types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Memo ¶
type Memo[T any] struct { // contains filtered or unexported fields }
Memo holds a cached value.
func NewMemo ¶
NewMemo creates a new Memo which will take its value from the specified update callback.
func (*Memo[T]) Invalidate ¶
func (this *Memo[T]) Invalidate()
Invalidate marks the Memo's value as invalid, which will cause it to be updated the next time Value is called.
type Optional ¶ added in v0.3.0
type Optional[T any] struct { // contains filtered or unexported fields }
Optional can either hold a value, or nothing.
type Set ¶
type Set[T comparable] map[T]struct{}
Set is a set of unique items, built on top of map.
func NewSet ¶ added in v0.4.0
func NewSet[T comparable](items ...T) Set[T]
NewSet creates a new set that contains all specified items.
Click to show internal directories.
Click to hide internal directories.