types

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MachineApi

type MachineApi interface {
	Add1(state string, args am.A) am.Result
	Add(states am.S, args am.A) am.Result
	Remove1(state string, args am.A) am.Result
	Remove(states am.S, args am.A) am.Result
	Set(states am.S, args am.A) am.Result
	AddErr(err error, args am.A) am.Result
	AddErrState(state string, err error, args am.A) am.Result

	WhenArgs(state string, args am.A, ctx context.Context) <-chan struct{}

	Err() error

	Log(msg string, args ...any)

	IsErr() bool
	Is(states am.S) bool
	Is1(state string) bool
	Not(states am.S) bool
	Not1(state string) bool
	Any(states ...am.S) bool
	Any1(state ...string) bool
	Has(states am.S) bool
	Has1(state string) bool
	IsTime(time am.Time, states am.S) bool
	IsClock(clock am.Clock) bool

	When(states am.S, ctx context.Context) <-chan struct{}
	When1(state string, ctx context.Context) <-chan struct{}
	WhenNot(states am.S, ctx context.Context) <-chan struct{}
	WhenNot1(state string, ctx context.Context) <-chan struct{}
	WhenTime(
		states am.S, times am.Time, ctx context.Context) <-chan struct{}
	WhenTicks(state string, ticks int, ctx context.Context) <-chan struct{}
	WhenTicksEq(state string, tick uint64, ctx context.Context) <-chan struct{}
	WhenErr(ctx context.Context) <-chan struct{}

	StateNames() am.S
	ActiveStates() am.S
	Tick(state string) uint64
	Clock(states am.S) am.Clock
	Time(states am.S) am.Time
	TimeSum(states am.S) uint64
	NewStateCtx(state string) context.Context
	Export() *am.Serialized
	GetStruct() am.Struct

	String() string
	StringAll() string
	Inspect(states am.S) string
	Index(state string) int
	Dispose()
	WhenDisposed() <-chan struct{}
}

MachineApi is a subset of `pkg/machine#Machine` for alternative implementations.

Jump to

Keyboard shortcuts

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