package reflect2

import (
	
	
)

type UnsafeStructType struct {
	unsafeType
	likePtr bool
}

func newUnsafeStructType( *frozenConfig,  reflect.Type) *UnsafeStructType {
	return &UnsafeStructType{
		unsafeType: *newUnsafeType(, ),
		likePtr:    likePtrType(),
	}
}

func ( *UnsafeStructType) () bool {
	return .likePtr
}

func ( *UnsafeStructType) ( interface{}) interface{} {
	 := unpackEFace()
	assertType("Type.Indirect argument 1", .ptrRType, .rtype)
	return .UnsafeIndirect(.data)
}

func ( *UnsafeStructType) ( unsafe.Pointer) interface{} {
	if .likePtr {
		return packEFace(.rtype, *(*unsafe.Pointer)())
	}
	return packEFace(.rtype, )
}

func ( *UnsafeStructType) ( string) StructField {
	,  := .Type.FieldByName()
	if ! {
		return nil
	}
	return newUnsafeStructField(, )
}

func ( *UnsafeStructType) ( int) StructField {
	return newUnsafeStructField(, .Type.Field())
}

func ( *UnsafeStructType) ( []int) StructField {
	return newUnsafeStructField(, .Type.FieldByIndex())
}

func ( *UnsafeStructType) ( func(string) bool) StructField {
	,  := .Type.FieldByNameFunc()
	if ! {
		panic("field match condition not found in " + .Type.String())
	}
	return newUnsafeStructField(, )
}