go/src/internal/reflectlite/type.go

type Type

type Kind

const Ptr

const Interface

const Slice

const String

const Struct

type nameOff

type typeOff

type textOff

type rtype

type uncommonType

type arrayType

type chanType

type funcType

type interfaceType

type ptrType

type sliceType

type structType

type name

func (n name) data(off int, whySafe string) *byte {}

func (n name) isExported() bool {}

func (n name) hasTag() bool {}

func (n name) embedded() bool {}

// readVarint parses a varint as encoded by encoding/binary.
// It returns the number of encoded bytes and the encoded value.
func (n name) readVarint(off int) (int, int) {}

func (n name) name() string {}

func (n name) tag() string {}

func pkgPath(n abi.Name) string {}

// resolveNameOff resolves a name offset from a base pointer.
// The (*rtype).nameOff method is a convenience wrapper for this function.
// Implemented in the runtime package.
//
//go:noescape
func resolveNameOff(ptrInModule unsafe.Pointer, off int32) unsafe.Pointer

// resolveTypeOff resolves an *rtype offset from a base type.
// The (*rtype).typeOff method is a convenience wrapper for this function.
// Implemented in the runtime package.
//
//go:noescape
func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer

func (t rtype) nameOff(off nameOff) abi.Name {}

func (t rtype) typeOff(off typeOff) *abi.Type {}

func (t rtype) uncommon() *uncommonType {}

func (t rtype) String() string {}

func (t rtype) common() *abi.Type {}

func (t rtype) exportedMethods() []abi.Method {}

func (t rtype) NumMethod() int {}

func (t rtype) PkgPath() string {}

func (t rtype) Name() string {}

func toRType(t *abi.Type) rtype {}

func elem(t *abi.Type) *abi.Type {}

func (t rtype) Elem() Type {}

func (t rtype) In(i int) Type {}

func (t rtype) Key() Type {}

func (t rtype) Len() int {}

func (t rtype) NumField() int {}

func (t rtype) NumIn() int {}

func (t rtype) NumOut() int {}

func (t rtype) Out(i int) Type {}

// add returns p+x.
//
// The whySafe string is ignored, so that the function still inlines
// as efficiently as p+x, but all call sites should use the string to
// record why the addition is safe, which is to say why the addition
// does not cause x to advance to the very end of p's allocation
// and therefore point incorrectly at the next block in memory.
func add(p unsafe.Pointer, x uintptr, whySafe string) unsafe.Pointer {}

// TypeOf returns the reflection Type that represents the dynamic type of i.
// If i is a nil interface value, TypeOf returns nil.
func TypeOf(i any) Type {}

func (t rtype) Implements(u Type) bool {}

func (t rtype) AssignableTo(u Type) bool {}

func (t rtype) Comparable() bool {}

// implements reports whether the type V implements the interface type T.
func implements(T, V *abi.Type) bool {}

// directlyAssignable reports whether a value x of type V can be directly
// assigned (using memmove) to a value of type T.
// https://golang.org/doc/go_spec.html#Assignability
// Ignoring the interface rules (implemented elsewhere)
// and the ideal constant rules (no ideal constants at run time).
func directlyAssignable(T, V *abi.Type) bool {}

func haveIdenticalType(T, V *abi.Type, cmpTags bool) bool {}

func haveIdenticalUnderlyingType(T, V *abi.Type, cmpTags bool) bool {}

// toType converts from a *rtype to a Type that can be returned
// to the client of package reflect. In gc, the only concern is that
// a nil *rtype must be replaced by a nil Type, but in gccgo this
// function takes care of ensuring that multiple *rtype for the same
// type are coalesced into a single Type.
func toType(t *abi.Type) Type {}