Expand description
Traits§
- Peek
- A trait for values that provide deserialization from buffers of bytes.
- Poke
- A trait for values that provide serialization into buffers of bytes.
Functions§
- ensure_
red_ zone - Add
T::max_size()“red zone” (padding of zeroes) to the end of the vec ofbytes. This allows deserialization to assert that at leastT::max_size()bytes exist at all times. - peek_
from_ ⚠default - Peek helper for constructing a
TbyDefaultinitialized stack allocation. - peek_
from_ slice - Peek inplace a
Tfrom a slice of bytes, returning a slice of the remaining bytes.srcmust contain at leastT::max_size()bytes. - peek_
from_ ⚠uninit - Peek helper for constructing a
TbyCopying into an uninitialized stack allocation. - poke_
extend_ vec - poke_
inplace_ slice - Poke helper to insert a serialized version of
srcat the beginning fordst. - poke_
into_ vec - Poke helper to append a serialized version of
srcto the end ofdst. - strip_
red_ zone - Remove the “red zone” (padding of zeroes) from the end of the vec of
bytes. This is effectively the inverse ofensure_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.