Adds a new, optional feature to the bytes crate to enable support for the Rust nightly unstable allocator_api feature (docs).
This feature is disabled by default and will only work on Rust nightly for now.
When enabled, this feature changes the default implementations of Buf and BufMut on Box<u8>, Vec<u8>, and VecDeque<u8> to support an optional second generic argument for an Allocator type. This Allocator controls how the type manages memory on the heap. No code paths are changed in the crate, only a new generic argument is provided to these types.
When disabled, this feature incurs no changes to the crate and does not change the API or any code paths.
Fixes #653.
Adds a new, optional feature to the
bytes
crate to enable support for the Rust nightly unstableallocator_api
feature (docs).This feature is disabled by default and will only work on Rust nightly for now.
When enabled, this feature changes the default implementations of
Buf
andBufMut
onBox<u8>
,Vec<u8>
, andVecDeque<u8>
to support an optional second generic argument for anAllocator
type. ThisAllocator
controls how the type manages memory on the heap. No code paths are changed in the crate, only a new generic argument is provided to these types.When disabled, this feature incurs no changes to the crate and does not change the API or any code paths.