Module serialize

Source
Expand description

Serialization.

Structs§

Buf
A byte slice wrapper providing buffer functionality.
BufView
A BufferView into a Buf.
BufViewMut
A BufferViewMut into a Buf.
BufferTooShortError
The error returned when a buffer is too short to hold a serialized packet, and the BufferProvider is incapable of allocating a new one.
ByteSliceInnerPacketBuilder
An InnerPacketBuilder created from any B: SplitByteSlice.
InnerSerializer
A Serializer constructed from an InnerPacketBuilder.
LimitedSizePacketBuilder
A PacketBuilder which has no header or footer, but which imposes a maximum body length constraint.
MaybeReuseBufferProvider
Provides an implementation of BufferProvider from a BufferAlloc A that attempts to reuse the input buffer and falls back to the allocator if the input buffer can’t be reused.
Nested
One object encapsulated in another one.
NoReuseBufferProvider
Provides an implementation of BufferProvider from a BufferAlloc A that never attempts to reuse the input buffer, and always create a new buffer from the allocator A.
PacketConstraints
The constraints required by a PacketBuilder.
SerializeTarget
The target buffers into which PacketBuilder::serialize serializes its header and footer.
TruncatingSerializer
A Serializer that truncates its body if it would exceed a size limit.

Enums§

Either
Either of two buffers.
EitherSerializer
Either of two serializers.
SerializeError
An error in serializing a packet.
TruncateDirection
The direction a buffer’s body should be truncated from to force it to fit within a size limit.

Traits§

BufferAlloc
An object capable of allocating new buffers.
BufferProvider
An object capable of providing buffers which satisfy certain constraints.
InnerPacketBuilder
A builder capable of serializing packets - which do not encapsulate other packets - into an existing buffer.
PacketBuilder
A builder capable of serializing a packet’s headers and footers.
Serializer

Functions§

new_buf_vec
Allocates a new Buf<Vec<u8>>.
try_reuse_buffer
Attempts to reuse a buffer for the purposes of implementing BufferProvider::reuse_or_realloc.