Add T::max_size()
“red zone” (padding of zeroes) to the end of the vec of
bytes
. This allows deserialization to assert that at least T::max_size()
bytes exist at all times.
Peek helper for constructing a T
by Default
initialized stack
allocation.
Peek inplace a T
from a slice of bytes, returning a slice of the remaining
bytes. src
must contain at least T::max_size()
bytes.
Peek helper for constructing a T
by Copy
ing into an uninitialized stack
allocation.
Poke helper to insert a serialized version of src
at the beginning for dst
.
Poke helper to append a serialized version of src
to the end of dst
.
Remove the “red zone” (padding of zeroes) from the end of the vec of bytes
.
This is effectively the inverse of ensure_red_zone
, with the caveat that
space reserved for the red zone is not un-reserved. Callers are repsonsible
for making sure the vec actually has a red zone, otherwise data bytes can
get stripped instead.