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.
DynSerializer
A type that provides Serializer via dynamic dispatch.
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.
PartialSerializeResult
Result returned by PartialSerializer::partial_serialize.
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.
DynamicSerializer
A marker trait that is used as an attestation of dynamic serialization capabilities.
InnerPacketBuilder
A builder capable of serializing packets - which do not encapsulate other packets - into an existing buffer.
LayoutBufferAlloc
A variant of BufferAlloc that allocates buffers with the necessary prefix, body, suffix layout.
PacketBuilder
A builder capable of serializing a packet’s headers and footers.
PartialPacketBuilder
A packet builder used for partial packet serialization.
PartialSerializer
A serializer that supports partial serialization.
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.