Expand description
A pool for creating byte-slices and strings that can be cheaply cloned and shared across threads
without allocating memory. Byte-slices are shared as Bytes, and strings are shared as
ByteStrings.
Internally, a BytesPool is a wrapper around a BytesMut buffer from the bytes crate.
It shares data by appending the data to its buffer and then splitting the buffer off with
BytesMut::split. This only allocates memory if the buffer needs to resize.
Structsยง
- Byte
String - An immutable UTF-8 encoded string using
Bytesas the storage. - Bytes
- A cheaply cloneable and sliceable chunk of contiguous memory.
- Bytes
Pool - A pool for creating byte-slices and strings that can be cheaply cloned and shared across threads
without allocating memory. Byte-slices are shared as
Bytes, and strings are shared asByteStrings.