Debian Codegraph @

README.md

raw symbols SCIP
1 # DivBuf
2
3 A library providing recursively divisible buffer objects.
4
5 [![Build Status](https://travis-ci.org/asomers/divbuf.svg?branch=master)](https://travis-ci.org/asomers/divbuf)
6 [![Crates.io](https://img.shields.io/crates/v/divbuf.svg?maxAge=2592000)](https://crates.io/crates/divbuf)
7
8 [Documentation](https://docs.rs/divbuf)
9
10 The `divbuf` crate provides a buffer structure `DivBufShared` that can be
11 efficiently and safely divided into multiple smaller buffers. Each child buffer
12 can be further divided, recursively. A primitive form of range-locking is
13 available: there is no way to create overlapping mutable child buffers.
14
15 This crate is similar to [`bytes`](https://crates.io/crates/bytes), but with a
16 few key differences:
17 - `bytes` is a COW crate. Data will be shared between multiple objects as
18 much as possible, but sometimes the data will be copied to new storage.
19 `divbuf`, onthe other hand, will _never_ copy data unless explicitly
20 requested.
21 - A `BytesMut` object always has the sole ability to access its own data.
22 Once a `BytesMut` object is created, there is no other way to modify or
23 even read its data that doesn't involve that object. A `DivBufMut`, on
24 the other hand, can share its data with a `DivBufShared`. After that
25 `DivBufMut` has been dropped, another can be created from the `DivBufShared`.
26 - `bytes` contains numerous optimizations for dealing with small arrays,
27 such as inline storage. However, some of those optimizations result in
28 data copying, which is anathema to `divbuf`. `divbuf` therefore does not
29 include them, and is optimized for working with large arrays.
30
31 # License
32
33 `divbuf` is distributed under the MIT license. See [LICENSE](LICENSE) for
34 details.