Module util

Source
Expand description

Utilities for common archive operations.

§Buffer access

Helper functions to get the root object of an archive under certain conditions.

§Alignment

Alignment helpers ensure that byte buffers are properly aligned when accessing and deserializing data.

Structs§

AlignedBytes
A buffer of bytes aligned to 16 bytes.
AlignedBytesResolver
The resolver for an archived AlignedBytes
AlignedVec
A vector of bytes that aligns its memory to 16 bytes.
ArchivedAlignedBytes
An archived AlignedBytes
Drain
A draining iterator for ScratchVec<T>.
ScratchVec
A vector view into serializer scratch space.

Functions§

archived_root
Casts an archived value from the given byte slice by calculating the root position.
archived_root_mut
Casts a mutable archived value from the given byte slice by calculating the root position.
archived_unsized_root
Casts a RelPtr to the given unsized type from the given byte slice by calculating the root position.
archived_unsized_root_mut
Casts a RelPtr to the given unsized type from the given byte slice by calculating the root position.
archived_unsized_value
Casts a RelPtr to the given unsized type from the given byte slice at the given position and returns the value it points to.
archived_unsized_value_mut
Casts a mutable RelPtr to the given unsized type from the given byte slice at the given position and returns the value it points to.
archived_value
Casts an archived value from the given byte slice at the given position.
archived_value_mut
Casts a mutable archived value from the given byte slice at the given position.
from_bytes_unchecked
Deserializes a value from the given bytes.
to_bytes
Serializes the given value and returns the resulting bytes.