Function capnp::serialize::read_message_from_flat_slice [−][src]
pub fn read_message_from_flat_slice<'a>(
slice: &mut &'a [u8],
options: ReaderOptions
) -> Result<Reader<SliceSegments<'a>>>
Reads a serialized message (including a segment table) from a flat slice of bytes, without copying.
The slice is allowed to extend beyond the end of the message. On success, updates slice
to point
to the remaining bytes beyond the end of the message.
ALIGNMENT: If the “unaligned” feature is enabled, then there are no alignment requirements on slice
.
Otherwise, slice
must be 8-byte aligned (attempts to read the message will trigger errors).