core/reflect
reflect
Types
6Bit_Field
Bit_Field :: struct {
name: string,
type: ^Type_Info,
size: uintptr,
offset: uintptr,
tag: Struct_Tag,
}SourceEnum_Field
Enum_Field :: struct {
name: string,
value: Type_Info_Enum_Value,
}SourceRepresents an Enum_Field storing the name and value
Struct_Field
Struct_Field :: struct {
name: string,
type: ^Type_Info,
tag: Struct_Tag,
offset: uintptr,
is_using: bool,
}SourceStruct_Field represents a information of a field of a struct
Struct_Field_Count_Method
Struct_Field_Count_Method :: enum int {
Top_Level = 0,
Using = 1,
Recursive = 2,
}SourceStruct_Field_Count_Method is the count method used by struct_field_count in order to find the number of fields
Struct_Tag
Struct_Tag :: stringSourceStruct_Tag represents the type of the string of a struct field
Through convention, tags are the concatenation of optionally space-separated key:"value" pairs. Each key is a non-empty string which contains no control characters other than space, quotes, and colon.
Type_Kind
Type_Kind :: enum int {
Invalid = 0,
Named = 1,
Integer = 2,
Rune = 3,
Float = 4,
Complex = 5,
Quaternion = 6,
String = 7,
Boolean = 8,
Any = 9,
Type_Id = 10,
Pointer = 11,
Multi_Pointer = 12,
Procedure = 13,
Array = 14,
Enumerated_Array = 15,
Dynamic_Array = 16,
Slice = 17,
Parameters = 18,
Struct = 19,
Union = 20,
Enum = 21,
Map = 22,
Bit_Set = 23,
Simd_Vector = 24,
Matrix = 25,
Soa_Pointer = 26,
Bit_Field = 27,
Fixed_Capacity_Dynamic_Array = 28,
}SourceConstants
34DEFAULT_EQUAL_MAX_RECURSION_LEVEL
DEFAULT_EQUAL_MAX_RECURSION_LEVEL :: 32SourceType_Info
Type_Info :: runtime.Type_InfoSourceType_Info_Any
Type_Info_Any :: runtime.Type_Info_AnySourceType_Info_Array
Type_Info_Array :: runtime.Type_Info_ArraySourceType_Info_Bit_Field
Type_Info_Bit_Field :: runtime.Type_Info_Bit_FieldSourceType_Info_Bit_Set
Type_Info_Bit_Set :: runtime.Type_Info_Bit_SetSourceType_Info_Boolean
Type_Info_Boolean :: runtime.Type_Info_BooleanSourceType_Info_Complex
Type_Info_Complex :: runtime.Type_Info_ComplexSourceType_Info_Dynamic_Array
Type_Info_Dynamic_Array :: runtime.Type_Info_Dynamic_ArraySourceType_Info_Enum
Type_Info_Enum :: runtime.Type_Info_EnumSourceType_Info_Enum_Value
Type_Info_Enum_Value :: runtime.Type_Info_Enum_ValueSourceType_Info_Enumerated_Array
Type_Info_Enumerated_Array :: runtime.Type_Info_Enumerated_ArraySourceType_Info_Fixed_Capacity_Dynamic_Array
Type_Info_Fixed_Capacity_Dynamic_Array :: runtime.Type_Info_Fixed_Capacity_Dynamic_ArraySourceType_Info_Float
Type_Info_Float :: runtime.Type_Info_FloatSourceType_Info_Integer
Type_Info_Integer :: runtime.Type_Info_IntegerSourceType_Info_Map
Type_Info_Map :: runtime.Type_Info_MapSourceType_Info_Matrix
Type_Info_Matrix :: runtime.Type_Info_MatrixSourceType_Info_Multi_Pointer
Type_Info_Multi_Pointer :: runtime.Type_Info_Multi_PointerSourceType_Info_Named
Type_Info_Named :: runtime.Type_Info_NamedSourceType_Info_Parameters
Type_Info_Parameters :: runtime.Type_Info_ParametersSourceType_Info_Pointer
Type_Info_Pointer :: runtime.Type_Info_PointerSourceType_Info_Procedure
Type_Info_Procedure :: runtime.Type_Info_ProcedureSourceType_Info_Quaternion
Type_Info_Quaternion :: runtime.Type_Info_QuaternionSourceType_Info_Rune
Type_Info_Rune :: runtime.Type_Info_RuneSourceType_Info_Simd_Vector
Type_Info_Simd_Vector :: runtime.Type_Info_Simd_VectorSourceType_Info_Slice
Type_Info_Slice :: runtime.Type_Info_SliceSourceType_Info_Soa_Pointer
Type_Info_Soa_Pointer :: runtime.Type_Info_Soa_PointerSourceType_Info_String
Type_Info_String :: runtime.Type_Info_StringSourceType_Info_Struct
Type_Info_Struct :: runtime.Type_Info_StructSourceType_Info_Type_Id
Type_Info_Type_Id :: runtime.Type_Info_Type_IdSourceType_Info_Union
Type_Info_Union :: runtime.Type_Info_UnionSourcetype_info_base
type_info_base :: runtime.type_info_baseSourcetype_info_base returns the base-type of a ^Type_Info stripping the distinctness from the first level
type_info_base_without_enum
type_info_base_without_enum :: type_info_coreSourcetype_info_base_without_enum returns the core-type of a ^Type_Info stripping the distinctness from the first level AND/OR returns the backing integer type of an enum or bit_set ^Type_Info. This is also aliased as type_info_core
type_info_core
type_info_core :: runtime.type_info_coreSourcetype_info_core returns the core-type of a ^Type_Info stripping the distinctness from the first level AND/OR returns the backing integer type of an enum or bit_set ^Type_Info. This is also aliased as type_info_base_without_enum
Procedures
112align_of_typeid
align_of_typeid :: proc(T: typeid) -> (int)Sourcereturns the alignment of the type that the passed typeid represents
any_base
any_base :: proc(v: any) -> (any)Sourceany_base returns an any where the typeid has been replaced with the base-type equivalent
any_core
any_core :: proc(v: any) -> (any)Sourceany_core returns an any where the typeid has been replaced with the core-type equivalent
any_data
any_data :: proc(v: any) -> (data: rawptr, id: typeid)SourceSplits the data stored in any into its two components: data and id
are_types_identical
are_types_identical :: proc(a: ^Type_Info, b: ^Type_Info) -> (bool)SourceReturns true when the ^Type_Infos are semantically equivalent types Note: The pointers being identical should be enough to check but this is done to make sure in certain cases where it is non-trivial and each value wants to be checked directly.
as_bool
as_bool :: proc(a: any) -> (value: bool, valid: bool)Sourceas_bytes
as_bytes :: proc(v: any) -> ([]u8)SourceReinterprets the data stored at v as a slice of bytes
as_f64
as_f64 :: proc(a: any) -> (value: f64, valid: bool)Sourceas_i64
as_i64 :: proc(a: any) -> (value: i64, valid: bool)Sourceas_int
as_int :: proc(a: any) -> (value: int, valid: bool)Sourceas_pointer
as_pointer :: proc(a: any) -> (value: rawptr, valid: bool)Sourceas_pointer attempts to convert an any to a rawptr. This only works for ^T, [^]T, cstring, cstring16 based types
as_raw_data
as_raw_data :: proc(a: any) -> (value: rawptr, valid: bool)SourceReturns the equivalent of doing raw_data(v) where v is a non-any value
as_string
as_string :: proc(a: any) -> (value: string, valid: bool)Sourceas_string16
as_string16 :: proc(a: any) -> (value: string16, valid: bool)Sourceas_string16 attempts to convert an any to a string16.
as_u64
as_u64 :: proc(a: any) -> (value: u64, valid: bool)Sourceas_uint
as_uint :: proc(a: any) -> (value: uint, valid: bool)Sourcebacking_type_kind
backing_type_kind :: proc(T: typeid) -> (Type_Kind)SourceReturns the Type_Kind of the core-type of a typeid. See
bit_field_names
bit_field_names :: proc(T: typeid) -> ([]string)Sourcebit_field_names returns a []string of the field names of a bit_field type T
bit_field_offsets
bit_field_offsets :: proc(T: typeid) -> ([]uintptr)Sourcebit_field_types returns a []uintptr of the field offsets in bits of a bit_field type T
bit_field_sizes
bit_field_sizes :: proc(T: typeid) -> ([]uintptr)Sourcebit_field_types returns a []uintptr of the field bit-width-sizes of a bit_field type T
bit_field_tags
bit_field_tags :: proc(T: typeid) -> ([]Struct_Tag)Sourcebit_field_types returns a []Struct_Tag of the field tags of a bit_field type T
bit_field_types
bit_field_types :: proc(T: typeid) -> ([]^Type_Info)Sourcebit_field_types returns a []^Type_Info of the field representation types of a bit_field type T, not the backing integer-bit-width types
bit_fields_zipped
bit_fields_zipped :: proc(T: typeid) -> (fields)SourceReturns the fields of a bit_field type T as an #soa slice. This is useful to iterate over.
Example:
for field, i in reflect.bit_fields_zipped(Foo_Bit_Field) { ... }bit_set_is_big_endian
bit_set_is_big_endian :: proc(value: any, loc = #caller_location) -> (bool)SourceUNSAFE: Checks to see if the data stored is a bit_set and is big endian. Panics if a bit_set was not passed.
capacity
capacity :: proc(val: any) -> (int)SourceReturns the capacity of the type that represents the any value, or returns 0 if not possible cap(^T) -> cap(T) cap([N]T) -> N cap(#simd[N]T) -> N cap([dynamic]T) cap(map[K]V)
default_map_hash_by_ptr
default_map_hash_by_ptr :: proc(ptr: ^T, seed: uintptr) -> (uintptr)Sourcederef
deref :: proc(val: any) -> (any)SourceDereferences any if it represents a pointer-based value (^T -> T)
enum_field_names
enum_field_names :: proc(Enum_Type: typeid) -> ([]string)Sourceenum_field_names returns []string of the names of the fields of type Enum_Type
enum_field_values
enum_field_values :: proc(Enum_Type: typeid) -> ([]Type_Info_Enum_Value)Sourceenum_field_values returns []Type_Info_Enum_Value of the values of the fields of type Enum_Type
enum_fields_zipped
enum_fields_zipped :: proc(Enum_Type: typeid) -> (fields)SourceReturns a #soa slice of the enum field information of type Enum_Type This is useful to iterate over.
Example:
for field, i in reflect.enum_fields_zipped(Foo) { ... }enum_from_name
enum_from_name :: proc(Enum_Type: typeid, name: string) -> (value: Enum_Type, ok: bool)SourceGiven an enum type and a value name, get the enum value.
enum_from_name_any
enum_from_name_any :: proc(Enum_Type: typeid, name: string) -> (value: Type_Info_Enum_Value, ok: bool)Sourceenum_from_name_any returns the value of an enum field's name if found, returns 0, false otherwise.
enum_name_from_value
enum_name_from_value :: proc(value: Enum_Type) -> (name: string, ok: bool)Sourceenum_name_from_value returns the name of enum field if a valid name using parametric polymorphism, otherwise returns "", false
enum_name_from_value_any
enum_name_from_value_any :: proc(value: any) -> (name: string, ok: bool)Sourceenum_name_from_value_any returns the name of enum field if a valid name using reflection, otherwise returns "", false
enum_string
enum_string :: proc(a: any) -> (string)SourceReturns the string representation of an enum value. It will panic if the value passed is not an enum.
enum_value_has_name
enum_value_has_name :: proc(value: T) -> (bool)SourceReturns whether the value given has a defined name in the enum type.
eq
eq :: proc(a: any, b: any, including_indirect_array_recursion: untyped boolean = false, recursion_level: untyped integer = 0) -> (bool)Sourceequal
equal :: proc(a: any, b: any, including_indirect_array_recursion: untyped boolean = false, recursion_level: untyped integer = 0) -> (bool)SourceChecks to see if two any values are semantically equivalent
get_union_as_ptr_variants
get_union_as_ptr_variants :: proc(val: ^T) -> (res: intrinsics.type_convert_variants_to_pointers(T))SourceConverts a pointer to a union, to a union containing the pointers to the variant types, and stores a pointer of the variant value in the new union
Example:
val: union{i32, f32, string}
val = "123"
ptr: union{^i32, ^f32, ^string} = get_union_as_ptr_variants(&val)
sp := ptr.(^string)
assert(sp^ == "123")get_union_variant
get_union_variant :: proc(a: any) -> (any)SourceReturns the underlying variant value of a union. Panics if a union was not passed.
get_union_variant_raw_tag
get_union_variant_raw_tag :: proc(a: any) -> (i64)SourceUNSAFE: Returns the underlying tag value of a union. Panics if a union was not passed.
has_no_indirections
has_no_indirections :: proc(ti: ^Type_Info) -> (bool)SourceThe ^Type_Info type refers to absolutely no internal pointers, meaning it can be trivially copied
index
index :: proc(val: any, i: int, loc = #caller_location) -> (any)SourceDynamically indexes any as an indexable-type if possible. Returns nil if not possible
is_any
is_any :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is an any, false otherwise.
is_array
is_array :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a fixed-array type ([N]T), false otherwise.
is_bit_set
is_bit_set :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a bit_set type, false otherwise.
is_boolean
is_boolean :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a boolean of any kind, false otherwise.
is_byte
is_byte :: proc(info: ^Type_Info) -> (bool)SourceReturns true when it is a 1-byte wide integer type, false otherwise.
is_complex
is_complex :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a complex-type of any kind, false otherwise.
is_cstring
is_cstring :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a cstring of any kind (cstring, cstring16), false otherwise.
is_cstring16
is_cstring16 :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a cstring of any kind (cstring16), false otherwise.
is_dynamic_array
is_dynamic_array :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a dynamic-array type ([dynamic]T), false otherwise.
is_dynamic_map
is_dynamic_map :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a map type (map[K]V), false otherwise.
is_endian_big
is_endian_big :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the core-type is represented with a platform-native endian type or the same endianness as the system. This will also return false when the type is not an integer, pointer, or bit_set. If the type is the same as the platform-native endian type (e.g. u32be on a big-endian system), this will return true.
is_endian_little
is_endian_little :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the core-type is represented with a platform-native endian type or the same endianness as the system. This will also return false when the type is not an integer, pointer, or bit_set. If the type is the same as the platform-native endian type (e.g. u32le on a little-endian system), this will return true.
is_endian_platform
is_endian_platform :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the core-type is represented with a platform-native endian type, and returns false otherwise. This will also return false when the type is not an integer, pointer, or bit_set. If the type is the same as the platform-native endian type (e.g. u32le on a little-endian system), this will return false.
is_enum
is_enum :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is an enum type, false otherwise.
is_enumerated_array
is_enumerated_array :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is an enumerated-array type ([Enum]T), false otherwise.
is_fixed_capacity_dynamic_array
is_fixed_capacity_dynamic_array :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a fixed-capacity dynamic-array type ([dynamic; N]T), false otherwise.
is_float
is_float :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a float of any kind, false otherwise.
is_integer
is_integer :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is an integer of any kind, false otherwise.
is_multi_pointer
is_multi_pointer :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a pointer-type of any kind ([^]T), false otherwise.
is_nil
is_nil :: proc(v: any) -> (bool)SourceReturns true if the any value is either nil or the data stored at the address is all zeroed
is_parameters
is_parameters :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type represents a set of parameters for a procedure (inputs or outputs), false otherwise.
is_pointer
is_pointer :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a pointer-type of any kind (^T or rawptr), false otherwise.
is_pointer_internally
is_pointer_internally :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a pointer-like type, false otherwise.
is_procedure
is_procedure :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a procedure type, false otherwise.
is_quaternion
is_quaternion :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a quaternions any kind, false otherwise.
is_raw_union
is_raw_union :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a struct type with #raw_union applied, when #raw_union is not applied, the value will be false. All other types will be false otherwise.
is_rune
is_rune :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a rune, false otherwise.
is_signed
is_signed :: proc(info: ^Type_Info) -> (bool)SourceReturns true if the base-type is a signed integer or just a float, false otherwise.
is_simd_vector
is_simd_vector :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a #simd-array type (#simd[N]T), false otherwise.
is_slice
is_slice :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a slice type ([]T), false otherwise.
is_soa_pointer
is_soa_pointer :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a pointer-type of any kind (#soa^T), false otherwise.
is_string
is_string :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a string of any kind (string, cstring, string16, cstring16), false otherwise.
is_string16
is_string16 :: proc(info: ^Type_Info) -> (bool)SourceReturns true the base-type is a string of any kind (string16, cstring16), false otherwise.
is_struct
is_struct :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a struct type, #raw_union will be false. All other types will be false otherwise.
is_union
is_union :: proc(info: ^Type_Info) -> (bool)SourceReturns true when the type is a union type (not #raw_union), false otherwise.
is_unsigned
is_unsigned :: proc(info: ^Type_Info) -> (bool)SourceReturns true if the base-type is an usigned integer, false otherwise.
iterate_array
iterate_array :: proc(val: any, it: ^int) -> (elem: any, index: int, ok: bool)SourceAn iterator to dynamically iterate across something that is array-like (or pointer-to-array-like)
Example:
it: int // used as a tracking value
for elem, idx in iterate_array(any_array_val, &it) { ... }iterate_map
iterate_map :: proc(val: any, it: ^int) -> (key: any, value: any, ok: bool)SourceAn iterator to dynamically iterate across map (or pointer-to-map)
Example:
it: int // used as a tracking value
for key, val in iterate_map(any_map_val, &it) { ... }length
length :: proc(val: any) -> (int)SourceReturns the length of the type that represents the any value, or returns 0 if not possible len(^T) -> len(T) len([N]T) -> N len(#simd[N]T) -> N len([]T) len([dynamic]T) len(map[K]V) len(string) or len(cstring) len(string16) or len(cstring16)
ne
ne :: proc(a: any, b: any, including_indirect_array_recursion: untyped boolean = false, recursion_level: untyped integer = 0) -> (bool)Sourcenot_equal
not_equal :: proc(a: any, b: any, including_indirect_array_recursion: untyped boolean = false, recursion_level: untyped integer = 0) -> (bool)SourceChecks to see if two any values are not semantically equivalent
relative_pointer_to_absolute_raw
relative_pointer_to_absolute_raw :: proc(data: rawptr, base_integer_id: typeid) -> (rawptr)Sourceset_union_value
set_union_value :: proc(dst: any, value: any) -> (bool)SourceUNSAFE: Manually set the variant value of a union using an any. Panics if a union was not passed.
set_union_variant_raw_tag
set_union_variant_raw_tag :: proc(a: any, tag: i64)SourceUNSAFE: Manually set the tag value of a union using an integer. Panics if a union was not passed.
set_union_variant_type_info
set_union_variant_type_info :: proc(a: any, tag_ti: ^Type_Info)SourceUNSAFE: Manually set the tag value of a union using a ^Type_Info. Panics if a union was not passed.
set_union_variant_typeid
set_union_variant_typeid :: proc(a: any, id: typeid)SourceUNSAFE: Manually set the tag value of a union using a typeid. Panics if a union was not passed.
size_of_typeid
size_of_typeid :: proc(T: typeid) -> (int)Sourcereturns the size of the type that the passed typeid represents
struct_field_at
struct_field_at :: proc(T: typeid, i: int) -> (field: Struct_Field)SourceReturns a Struct_Field containing the information for a struct field of a typeid T at index i
struct_field_by_name
struct_field_by_name :: proc(T: typeid, name: string) -> (field: Struct_Field)SourceReturns a Struct_Field containing the information for a struct field by name of a typeid T
struct_field_count
struct_field_count :: proc(T: typeid, method = Struct_Field_Count_Method.Top_Level) -> (count: int)SourceCounts the number of fields in a struct
This procedure returns the number of fields in a struct, counting in one of three ways:
- .Top_Level: Only counts the top-level fields
- .Using: Same count as .Top_Level, and adds the field count of any
using s: Structit encounters (in addition to itself) - .Recursive: The count of all top-level fields, plus the count of any child struct's fields, recursively
Inputs:
- T: The struct type
- method: The counting method
Returns:
- The
count, enumerated using themethod, which will be0if the type is not a struct
Example:
symbols_loaded, ok := dynlib.initialize_symbols(&game_api, "game.dll")
symbols_expected := reflect.struct_field_count(Game_Api) - API_PRIVATE_COUNT
if symbols_loaded != symbols_expected {
fmt.eprintf("Expected %v symbols, got %v", symbols_expected, symbols_loaded)
return
}struct_field_names
struct_field_names :: proc(T: typeid) -> ([]string)SourceReturns a []string of the names of the struct fields of type T
struct_field_offsets
struct_field_offsets :: proc(T: typeid) -> ([]uintptr)SourceReturns a []uintptr of the offsets in bytes of the struct fields of type T
struct_field_tags
struct_field_tags :: proc(T: typeid) -> ([]Struct_Tag)SourceReturns a []Struct_Tag of the tags of the struct fields of type T
struct_field_types
struct_field_types :: proc(T: typeid) -> ([]^Type_Info)SourceReturns a []^Type_Info of the types of the struct fields of type T
struct_field_value
struct_field_value :: proc(a: any, field: Struct_Field) -> (any)SourceReturns an any of a struct field specified by a Struct_Field
Example:
field := struct_field_value_by_name(the_struct, "field_name")
value_by_field := struct_field_value(the_struct, field)struct_field_value_by_name
struct_field_value_by_name :: proc(a: any, field: string, allow_using: untyped boolean = false) -> (any)SourceReturns an any of a struct field specified by name
Example:
v := struct_field_value_by_name(the_struct, "field_name")
nested_value_through_using := struct_field_value_by_name(the_struct, "field_name", allow_using=true)struct_fields_zipped
struct_fields_zipped :: proc(T: typeid) -> (fields)SourceReturns the fields of a struct type T as an #soa slice. This is useful to iterate over.
Example:
for field, i in reflect.struct_fields_zipped(Foo) { ... }struct_tag_get
struct_tag_get :: proc(tag: Struct_Tag, key: string) -> (value: string)Sourcestruct_tag_get returns the value associated with a key in the tag string. If the key is present in the tag, the value (which might be empty) is returned. Otherwise an empty string is returned. This is just a wrapper around struct_tag_lookup with the ok value being ignored.
The convention for struct tags is usually of the form:
`key:"value" another:"set" and:"whatever"`struct_tag_lookup
struct_tag_lookup :: proc(tag: Struct_Tag, key: string) -> (value: string, ok: bool)Sourcestruct_tag_lookup returns the value associated with a key in the tag string. If the key is present in the tag, the value (which might be empty) is return. Otherwise an empty string is returned. The ok value returns whether the value was explicit set in the tag string.
The convention for struct tags is usually of the form:
`key:"value" another:"set" and:"whatever"`type_info_union_is_pure_maybe
type_info_union_is_pure_maybe :: proc(info: runtime.Type_Info_Union) -> (bool)SourceReturns whether the Type_Info_Union store no tag (called a "pure maybe").
type_kind
type_kind :: proc(T: typeid) -> (Type_Kind)Sourcetype_kind returns a enum Type_Kind to state what kind of type a typeid is
typeid_elem
typeid_elem :: proc(id: typeid) -> (typeid)Sourcetypeid_elem returns a typeid of the element-type of a type if possible, otherwise it returns itself complex32 -> f16 complex64 -> f32 complex128 -> f64 quaternion64 -> f16 quaternion128 -> f32 quaternion256 -> f64 ^T -> T [^]T -> T
soa^T -> T
[N]T -> T []T -> T [dynamic]T -> T
simd[N]T -> T
underlying_type_kind
underlying_type_kind :: proc(T: typeid) -> (Type_Kind)SourceReturns the Type_Kind of the base-type of a typeid.
union_variant_type_info
union_variant_type_info :: proc(a: any) -> (^Type_Info)SourceReturns ^Type_Info of a any-encoded union type. Panics if a union was not passed.
union_variant_typeid
union_variant_typeid :: proc(a: any) -> (typeid)SourceUNSAFE: Returns typeid of a any-encoded union type. Panics if a union was not passed.
write_type_builder
write_type_builder :: proc(buf: ^strings.Builder, ti: ^Type_Info) -> (int)SourceWrites a ^Type_Info in standard (non-canonical) form to a strings.Builder
write_type_writer
write_type_writer :: proc(w: io.Writer, ti: ^Type_Info, n_written: ^int) -> (n: int, err: io.Error)SourceWrites a ^Type_Info in standard (non-canonical) form to an io.Writer
write_typeid_builder
write_typeid_builder :: proc(buf: ^strings.Builder, id: typeid, n_written: ^int) -> (n: int, err: io.Error)SourceWrites a typeid in standard (non-canonical) form to a strings.Builder
write_typeid_writer
write_typeid_writer :: proc(writer: io.Writer, id: typeid, n_written: ^int) -> (n: int, err: io.Error)SourceWrites a typeid in standard (non-canonical) form to an io.Writer
Procedure Groups
2write_type
write_type :: proc{write_type_builder, write_type_writer}SourceWrites a ^Type_Info in standard (non-canonical) form
write_typeid
write_typeid :: proc{write_typeid_builder, write_typeid_writer}SourceWrites a typeid in standard (non-canonical) form