Function capnp::serialize::try_read_message_no_alloc

source ·
pub fn try_read_message_no_alloc<R>(
    read: R,
    buffer: &mut [u8],
    options: ReaderOptions
) -> Result<Option<Reader<NoAllocBufferSegments<&[u8]>>>>
where R: Read,
Expand description

Like try_read_message(), but does not allocate any memory. Stores the message in buffer. Returns a BufferNotLargeEnough error if the buffer is not large enough. ALIGNMENT: If the “unaligned” feature is enabled, then there are no alignment requirements on buffer. Otherwise, buffer must be 8-byte aligned (attempts to read the message will trigger errors).