Package
core.encoding.protobuf
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 :: struct {
fields: [] Proto_Field_Descriptor
by_number: [] i32
}Unmarshal_Error :: union {
Err: [] u8
EOF: void
Unexpected_EOF: void
Unknown_Type: type_expr
Unknown_Field:
} lookup_protobuf_descriptor :: (type: type_expr) -> &Proto_Message_Descriptorunmarshal_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 :: (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.