lazy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lazy

type Lazy[T any] struct {
	// contains filtered or unexported fields
}

Lazy is a lazy value.

func NewLazy

func NewLazy[T any](compute func() T) *Lazy[T]

func (*Lazy[T]) Get

func (self *Lazy[T]) Get() T

func (*Lazy[T]) With

func (self *Lazy[T]) With(consumer func(T))

type OnceCell added in v0.3.0

type OnceCell[T any] struct {
	// contains filtered or unexported fields
}

func NewOnceCell added in v0.3.0

func NewOnceCell[T any]() OnceCell[T]

func (*OnceCell[T]) Get added in v0.3.0

func (self *OnceCell[T]) Get() *T

type OnceLazy

type OnceLazy[T any] struct {
	// contains filtered or unexported fields
}

OnceLazy is a lazy value that is computed only once.

func NewOnceLazy

func NewOnceLazy[T any](compute func() T) *OnceLazy[T]

func (*OnceLazy[T]) Get

func (self *OnceLazy[T]) Get() T

func (*OnceLazy[T]) With

func (self *OnceLazy[T]) With(consumer func(T))

Jump to

Keyboard shortcuts

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