go/src/internal/abi/type.go

type Type

type Kind

const Invalid

const Bool

const Int

const Int8

const Int16

const Int32

const Int64

const Uint

const Uint8

const Uint16

const Uint32

const Uint64

const Uintptr

const Float32

const Float64

const Complex64

const Complex128

const Array

const Chan

const Func

const Interface

const Map

const Pointer

const Slice

const String

const Struct

const UnsafePointer

const KindDirectIface

const KindGCProg

const KindMask

type TFlag

const TFlagUncommon

const TFlagExtraStar

const TFlagNamed

const TFlagRegularMemory

const TFlagUnrolledBitmap

type NameOff

type TypeOff

type TextOff

// String returns the name of k.
func (k Kind) String() string {}

var kindNames

// TypeOf returns the abi.Type of some value.
func TypeOf(a any) *Type {}

// TypeFor returns the abi.Type for a type parameter.
func TypeFor[T any]() *Type {}

func (t *Type) Kind() Kind {}

func (t *Type) HasName() bool {}

// Pointers reports whether t contains pointers.
func (t *Type) Pointers() bool {}

// IfaceIndir reports whether t is stored indirectly in an interface value.
func (t *Type) IfaceIndir() bool {}

// isDirectIface reports whether t is stored directly in an interface value.
func (t *Type) IsDirectIface() bool {}

func (t *Type) GcSlice(begin, end uintptr) []byte {}

type Method

type UncommonType

func (t *UncommonType) Methods() []Method {}

func (t *UncommonType) ExportedMethods() []Method {}

// addChecked 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 addChecked(p unsafe.Pointer, x uintptr, whySafe string) unsafe.Pointer {}

type Imethod

type ArrayType

// Len returns the length of t if t is an array type, otherwise 0
func (t *Type) Len() int {}

func (t *Type) Common() *Type {}

type ChanDir

const RecvDir

const SendDir

const BothDir

const InvalidDir

type ChanType

type structTypeUncommon

// ChanDir returns the direction of t if t is a channel type, otherwise InvalidDir (0).
func (t *Type) ChanDir() ChanDir {}

// Uncommon returns a pointer to T's "uncommon" data if there is any, otherwise nil
func (t *Type) Uncommon() *UncommonType {}

// Elem returns the element type for t if t is an array, channel, map, pointer, or slice, otherwise nil.
func (t *Type) Elem() *Type {}

// StructType returns t cast to a *StructType, or nil if its tag does not match.
func (t *Type) StructType() *StructType {}

// MapType returns t cast to a *OldMapType or *SwissMapType, or nil if its tag does not match.
func (t *Type) MapType() *mapType {}

// ArrayType returns t cast to a *ArrayType, or nil if its tag does not match.
func (t *Type) ArrayType() *ArrayType {}

// FuncType returns t cast to a *FuncType, or nil if its tag does not match.
func (t *Type) FuncType() *FuncType {}

// InterfaceType returns t cast to a *InterfaceType, or nil if its tag does not match.
func (t *Type) InterfaceType() *InterfaceType {}

// Size returns the size of data with type t.
func (t *Type) Size() uintptr {}

// Align returns the alignment of data with type t.
func (t *Type) Align() int {}

func (t *Type) FieldAlign() int {}

type InterfaceType

func (t *Type) ExportedMethods() []Method {}

func (t *Type) NumMethod() int {}

// NumMethod returns the number of interface methods in the type's method set.
func (t *InterfaceType) NumMethod() int {}

func (t *Type) Key() *Type {}

type SliceType

type FuncType

func (t *FuncType) In(i int) *Type {}

func (t *FuncType) NumIn() int {}

func (t *FuncType) NumOut() int {}

func (t *FuncType) Out(i int) *Type {}

func (t *FuncType) InSlice() []*Type {}

func (t *FuncType) OutSlice() []*Type {}

func (t *FuncType) IsVariadic() bool {}

type PtrType

type StructField

func (f *StructField) Embedded() bool {}

type StructType

type Name

// DataChecked does pointer arithmetic on n's Bytes, and that arithmetic is asserted to
// be safe for the reason in whySafe (which can appear in a backtrace, etc.)
func (n Name) DataChecked(off int, whySafe string) *byte {}

// Data does pointer arithmetic on n's Bytes, and that arithmetic is asserted to
// be safe because the runtime made the call (other packages use DataChecked)
func (n Name) Data(off int) *byte {}

// IsExported returns "is n exported?"
func (n Name) IsExported() bool {}

// HasTag returns true iff there is tag data following this name
func (n Name) HasTag() bool {}

// IsEmbedded returns true iff n is embedded (an anonymous field).
func (n Name) IsEmbedded() 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) {}

// IsBlank indicates whether n is "_".
func (n Name) IsBlank() bool {}

// writeVarint writes n to buf in varint form. Returns the
// number of bytes written. n must be nonnegative.
// Writes at most 10 bytes.
func writeVarint(buf []byte, n int) int {}

// Name returns the tag string for n, or empty if there is none.
func (n Name) Name() string {}

// Tag returns the tag string for n, or empty if there is none.
func (n Name) Tag() string {}

func NewName(n, tag string, exported, embedded bool) Name {}

const TraceArgsLimit

const TraceArgsMaxDepth

const TraceArgsMaxLen

const TraceArgsEndSeq

const TraceArgsStartAgg

const TraceArgsEndAgg

const TraceArgsDotdotdot

const TraceArgsOffsetTooLarge

const TraceArgsSpecial

const MaxPtrmaskBytes