9.6 Zero-copy views
decode_view<T>(buf: &bytes) -> view T | DecodeErrorvalidates the structure of the buffer and returns a view that reads fields lazily without copying.view Tis a borrow (§7.2): it lives no longer than the buffer.v.own() -> Tcreates an ordinary value.- In rpc handlers a parameter of type
view Treceives a view over the request buffer.
Implementation-defined. Laziness of
view Tand the limits of validation (D-8051; DIV-046; D-6501..D-6505). The Standard requires that aview Tdoes not outlive the buffer; lazy reading is an optimisation. This implementation: only the OxL binary format and direct fields are supported; validation on creating a view decodes the value in full; an escape of a view out of its block through a variable of an outer block is not detected.
Source: docs/spec/oxl-standard.en.md