Expand description
Public low-level wire primitives for generated code (see
crate::codegen). Everything here is bounds-checked and unsafe-free;
generated readers/writers compose these with offsets computed at
generation time from the deterministic layout algorithm.
Nothing in this module is needed for normal (dynamic) use of the library.
Functions§
- alloc_
block - Reserve a zeroed, aligned block and return its absolute offset.
- alloc_
bytes - Reserve
nzeroed bytes at the current position, returning their offset. - begin_
list - Write a list header (count, then padding so elements start aligned).
Returns the list offset to patch into the referencing slot. Elements
(
count * stridebytes) must be appended immediately after. - charge
- Charge
bytesagainst an optional traversal budget.None(the trusted, unbounded path) is a no-op the optimizer removes. - finish_
message - Patch the root offset into the header.
- list_
header - Follow a u32 offset slot at
slotto a list header. Returns (elements base, count); elements arestrideapart per the schema layout. - message_
header - Start a message buffer: header, optional inline schema, padding to 8.
- pad_to
- patch_
u32 - pos
- push_
bool - push_
bool_ slice - push_
f32 - push_
f64 - push_
f32_ slice - push_
f64_ slice - push_i8
- push_
i8_ slice - push_
i16 - push_
i32 - push_
i64 - push_
i16_ slice - push_
i32_ slice - push_
i64_ slice - push_u8
- push_
u8_ slice - push_
u16 - push_
u32 - push_
u64 - push_
u16_ slice - push_
u32_ slice - push_
u64_ slice - put_
bool - put_f32
- put_f64
- put_i8
- put_i16
- put_i32
- put_i64
- put_u8
- put_u16
- put_u32
- put_u64
- read_
bool - read_
bytes - Follow a u32 offset slot at
slotto a length-prefixed blob. - read_
bytes_ budgeted read_byteswith the payload charged against the budget first.- read_
f32 - read_
f64 - read_i8
- read_
i16 - read_
i32 - read_
i64 - read_
slice - read_
str - Follow a u32 offset slot at
slotto a length-prefixed UTF-8 string. - read_
str_ budgeted read_strwith the payload charged against the budget before it is touched, so a bounded read can never exceed its budget even transiently.- read_u8
- read_
u16 - read_
u32 - read_
u64 - set_
presence_ bit - Set presence bit
posin the bitmap at the start of a struct block. - write_
blob - Append a length-prefixed blob (string/bytes payload), returning its offset.