Packages

builtin
cbindgen
core
core.alloc
core.alloc.arena
core.alloc.atomic
core.alloc.fixed
core.alloc.gc
core.alloc.heap
core.alloc.log
core.alloc.memdebug
core.alloc.pool
core.alloc.ring
core.arg_parse
core.array
core.avl_tree
core.bucket_array
core.conv
core.doc
core.encoding
core.encoding.base64
core.encoding.csv
core.encoding.hex
core.encoding.json
core.encoding.kdl
core.encoding.osad
core.encoding.utf8
core.hash
core.hash.md5
core.hash.sha1
core.hash.sha256
core.heap
core.intrinsics
core.intrinsics.atomics
core.intrinsics.onyx
core.intrinsics.types
core.intrinsics.wasm
core.io
core.io.binary
core.iter
core.js
core.list
core.map
core.math
core.memory
core.misc
core.net
core.os
core.random
core.set
core.slice
core.string
core.sync
core.test
core.thread
core.time
main
runtime
runtime.info
runtime.platform
runtime.vars
simd

package core.misc

any_as
any_as :: (a: any, $T: type_expr) -> &T
any_as_array
any_as_array :: (arr: any) -> (rawptr, type_expr, u32)
any_deep_copy
any_deep_copy :: (args: [] any, allocator: Allocator) -> [] any

Creates a deep copy of an array of anys.

Copies the slice to a new slice, and all of the any data members.

any_dereference
any_dereference :: (v: any) -> any

Dereference a pointer any.

any_iter
any_iter :: (arr: any) -> Iterator(any)

Creates an iterator out of an array-like any.

any_member
any_member :: (v: any, member_type: type_expr, member_offset: u32) -> any
any_member :: (v: any, member: &Type_Info_Struct.Member) -> any
any_nested_selector
any_nested_selector :: (v: any, member_name: [] u8) -> any

Like any_selector, but works with selecting "foo.bar.joe".

any_selector
any_selector :: (v: any, member_name: [] u8) -> any

Select a member from an any.

any_subscript
any_subscript :: (v: any, index: i32) -> any

Subscript an array-like any.

any_to_map
any_to_map :: (v: any) -> ? Map([] u8, any)

Convert a structure or pointer to a structure to a Map with keys representing the fields of the structure, and values representing the value of each field.

T :: struct {
    x := 123;
    y := "test";
}

m := any_to_map(T.{});

m would have two keys, "x" and "y".

any_unwrap
any_unwrap :: (v: any) -> any

Unwraps an optional any, if the any is an optional. ? T -> T

to_any
to_any :: macro (x: &$T) -> #auto