Skip to main content

Crate bytes_pool

Crate bytes_pool 

Source
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ยง

ByteString
An immutable UTF-8 encoded string using Bytes as the storage.
Bytes
A cheaply cloneable and sliceable chunk of contiguous memory.
BytesPool
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.