Packages

builtin
cbindgen
core
core.alloc
core.alloc.arena
core.alloc.atomic
core.alloc.debug
core.alloc.fixed
core.alloc.gc
core.alloc.heap
core.alloc.log
core.alloc.memwatch
core.alloc.pool
core.alloc.ring
core.arg_parse
core.array
core.avl_tree
core.bucket_array
core.bytes
core.conv
core.crypto
core.crypto.keys
core.doc
core.encoding
core.encoding.base64
core.encoding.csv
core.encoding.hex
core.encoding.json
core.encoding.kdl
core.encoding.osad
core.encoding.protobuf
core.encoding.utf8
core.encoding.xml
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.iter
core.libc
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
runtime
runtime.info
runtime.platform
runtime.vars
simd

Package

core.encoding.protobuf

Field
Field :: struct {
    number: i32
    protobuf_type: u32
}
Proto_Field_Descriptor
Proto_Field_Descriptor :: struct {
    is_optional: bool
    is_repeated: bool
    is_oneof: bool
    optional_offset: u16
    oneof_tag_size: u16
    oneof_tag: u32
    field_offset: i32
    field_size: i32
    field_type: type_expr
    proto_field_type: _Field_Type
    proto_field_number: i32
}
Proto_Message_Descriptor
Proto_Message_Descriptor :: struct {
    fields: [] Proto_Field_Descriptor
    by_number: [] i32
}
Marshal_Error
Marshal_Error :: union {
    Err: [] u8
    Unknown_Type: type_expr
}
Unmarshal_Error
Unmarshal_Error :: union {
    Err: [] u8
    EOF: void
    Unexpected_EOF: void
    Unknown_Type: type_expr
    Unknown_Field: 
}
Message
Message :: #distinct void
apply_field_tag
apply_field_tag :: (tags: [] any, dest: &Proto_Field_Descriptor) -> void
lookup_protobuf_descriptor
lookup_protobuf_descriptor :: (type: type_expr) -> &Proto_Message_Descriptor
marshal
marshal
marshal :: (input: $T) -> Result(str, Marshal_Error)
marshal :: (input: $T, dest: &dyn_str) -> Result(bool, Marshal_Error)
read_union_tag
read_union_tag :: (base: rawptr, size: u16) -> u32
unmarshal
unmarshal :: (input: [] u8, $type: type_expr, allocator) -> Result(type, Unmarshal_Error)
unmarshal_each
unmarshal_each :: macro (input: [] u8, field_number: i32, $type: type_expr, $body: Code) -> void

Decode a stream of length-delimited messages on field_number without allocating the outer repeated array. The body is inlined at the call site. Pass a Code block with one capture (ev] { ... }); that capture is &type.

String fields alias input. Keep input alive for as long as those strings are used.

unmarshal_next_message
unmarshal_next_message :: (data: &[] u8, field_number: i32, out: rawptr, type: type_expr, copy_strings: bool) -> Result(bool, Unmarshal_Error)

Decode the next length-delimited message on field_number. Returns true if out was filled, false if the stream is exhausted. If copy_strings is false, str/] u8 fields alias data; the caller must keep those bytes alive.

write_union_tag
write_union_tag :: (base: rawptr, tag: u32, size: u16) -> void