Skip to main content

with_struct_view

Function with_struct_view 

Source
pub fn with_struct_view<T>(on: bool, f: impl FnOnce() -> T) -> T
Expand description

Encode structs in the offset-table T_STRUCT_VIEW layout for the duration of f, so a WireView reads any single field in O(1) (the Cap’n Proto-beating random-access mode). Larger than the packed forms — it is the speed end of the size↔speed dial.