nature

package
v1.16.11 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StructFields

func StructFields(t reflect.Type) map[string]Nature

Types

type Nature

type Nature struct {
	Type         reflect.Type      // Type of the value. If nil, then value is unknown.
	Func         *builtin.Function // Used to pass function type from callee to CallNode.
	ArrayOf      *Nature           // Elem nature of array type (usually Type is []any, but ArrayOf can be any nature).
	PredicateOut *Nature           // Out nature of predicate.
	Fields       map[string]Nature // Fields of map type.
	Strict       bool              // If map is types.StrictMap.
	Nil          bool              // If value is nil.
	Method       bool              // If value retrieved from method. Usually used to determine amount of in arguments.
	MethodIndex  int               // Index of method in type.
	FieldIndex   []int             // Index of field in type.
}

func (Nature) All

func (n Nature) All() map[string]Nature

func (Nature) AssignableTo

func (n Nature) AssignableTo(nt Nature) bool

func (Nature) Deref

func (n Nature) Deref() Nature

func (Nature) Elem

func (n Nature) Elem() Nature

func (Nature) FieldByName

func (n Nature) FieldByName(name string) (Nature, bool)

func (Nature) Get

func (n Nature) Get(name string) (Nature, bool)

func (Nature) In

func (n Nature) In(i int) Nature

func (Nature) IsFastMap

func (n Nature) IsFastMap() bool

func (Nature) IsVariadic

func (n Nature) IsVariadic() bool

func (Nature) Key

func (n Nature) Key() Nature

func (Nature) Kind

func (n Nature) Kind() reflect.Kind

func (Nature) MethodByName

func (n Nature) MethodByName(name string) (Nature, bool)

func (Nature) NumIn

func (n Nature) NumIn() int

func (Nature) NumOut

func (n Nature) NumOut() int

func (Nature) Out

func (n Nature) Out(i int) Nature

func (Nature) String

func (n Nature) String() string

Jump to

Keyboard shortcuts

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