lazy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 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 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