Function fuel_types::bytes::store_bytes[][src]

pub fn store_bytes<'a>(
    buf: &'a mut [u8],
    bytes: &[u8]
) -> Result<(usize, &'a mut [u8])>
Expand description

Attempt to store into the provided buffer the length of bytes as big-endian, and then the bytes itself. The bytes will be padded to be word-aligned.

If the buffer is big enough to store length+bytes, will return the amount of bytes written and the remainder of the buffer. Return std::io::Error otherwise.