4 releases (2 breaking)
|0.3.1||Dec 8, 2018|
|0.3.0||Oct 27, 2018|
|0.2.0||Jul 1, 2018|
|0.1.0||Mar 2, 2018|
#300 in Data structures
22 downloads per month
Used in 2 crates
A library providing recursively divisible buffer objects.
divbuf crate provides a buffer structure
DivBufShared that can be
efficiently and safely divided into multiple smaller buffers. Each child buffer
can be further divided, recursively. A primitive form of range-locking is
available: there is no way to create overlapping mutable child buffers.
This crate is similar to
bytes, but with a
few key differences:
bytesis a COW crate. Data will be shared between multiple objects as much as possible, but sometimes the data will be copied to new storage.
divbuf, onthe other hand, will never copy data unless explicitly requested.
BytesMutobject always has the sole ability to access its own data. Once a
BytesMutobject is created, there is no other way to modify or even read its data that doesn't involve that object. A
DivBufMut, on the other hand, can share its data with a
DivBufShared. After that
DivBufMuthas been dropped, another can be created from the
bytescontains numerous optimizations for dealing with small arrays, such as inline storage. However, some of those optimizations result in data copying, which is anathema to
divbuftherefore does not include them, and is optimized for working with large arrays.
divbuf is distributed under the MIT license. See LICENSE for