mixins

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStopTreeIter = errors.New("stop tree iteration")

Functions

func Mixins

func Mixins[T any](obj T, topDown bool) iter.Seq2[T, int]

func MixinsFunc

func MixinsFunc[T any](obj T, topDown bool, fn func(obj T, depth int) iter.Seq[T]) iter.Seq2[T, int]

func NillSeq

func NillSeq[K any](yield func(K) bool)

Types

type Definer

type Definer[T any] interface {
	Mixins() []T
}

type MixinTree

type MixinTree[T any] struct {
	Root  T
	Nodes []*MixinTree[T]
}

func BuildMixinTree

func BuildMixinTree[T any](obj T) *MixinTree[T]

func BuildMixinTreeFunc

func BuildMixinTreeFunc[T any](obj T, fn func(obj T, depth int) iter.Seq[T]) *MixinTree[T]

func (*MixinTree[T]) ForEach

func (t *MixinTree[T]) ForEach(topDown bool, fn func(node *MixinTree[T], depth int) error) error

Jump to

Keyboard shortcuts

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