Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asomers/divbuf
Recursively divisible buffers for Rust
https://github.com/asomers/divbuf
Last synced: about 2 months ago
JSON representation
Recursively divisible buffers for Rust
- Host: GitHub
- URL: https://github.com/asomers/divbuf
- Owner: asomers
- License: mit
- Created: 2018-03-01T22:16:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-13T20:11:57.000Z (2 months ago)
- Last Synced: 2024-10-14T02:46:17.439Z (2 months ago)
- Language: Rust
- Size: 713 KB
- Stars: 11
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# DivBuf
A library providing recursively divisible buffer objects.
[![Build Status](https://travis-ci.org/asomers/divbuf.svg?branch=master)](https://travis-ci.org/asomers/divbuf)
[![Crates.io](https://img.shields.io/crates/v/divbuf.svg?maxAge=2592000)](https://crates.io/crates/divbuf)[Documentation](https://docs.rs/divbuf)
The `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`](https://crates.io/crates/bytes), but with a
few key differences:
- `bytes` is 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.
- A `BytesMut` object always has the sole ability to access its own data.
Once a `BytesMut` object 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
`DivBufMut` has been dropped, another can be created from the `DivBufShared`.
- `bytes` contains numerous optimizations for dealing with small arrays,
such as inline storage. However, some of those optimizations result in
data copying, which is anathema to `divbuf`. `divbuf` therefore does not
include them, and is optimized for working with large arrays.# License
`divbuf` is distributed under the MIT license. See [LICENSE](LICENSE) for
details.