18 releases (breaking)
0.19.2 | Jan 24, 2025 |
---|---|
0.18.0 | Jan 19, 2025 |
0.11.0 | Dec 15, 2024 |
0.11.0-alpha.1 | Nov 28, 2024 |
0.1.2 |
|
#443 in Rust patterns
1,202 downloads per month
Used in tribles
32KB
799 lines
This Library is still pre-0.1.0 the API is therefore in heavy flux, and everything should be considered alpha!
A small library for conveniently working with immutables bytes from different sources, providing zero-copy slicing and cloning.
Access itself is extremely cheap via no-op conversion to a &[u8]
.
The storage mechanism backing the bytes can be extended
and is implemented for a variety of sources already,
including other byte handling crates Bytes
, mmap-ed files,
String
s and Zerocopy
types.
Comparison
Crate | Active | Extensible | mmap support | Zerocopy Integration | Pyo3 Integration | kani verified |
---|---|---|---|---|---|---|
anybytes | ✅ | ✅ | ✅ | ✅ | ✅ | 🚧 |
bytes | ✅ | ✅ | ✅[^1] | ❌ | ❌ | ❌ |
ownedbytes | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
minibytes | ✅[^2] | ✅ | ✅ | ❌ | ❌ | ❌ |
[^1]: Recently added a new "Owned Bytes" variant, which still has all the downsides of a V-Table. [^2]: Recently published again.
Acknowledgements
This library started as a fork of the minibyte library in facebooks sapling scm.
Thanks to @kylebarron for his feedback and ideas on Pyo3 integration.
Dependencies
~1–2.2MB
~40K SLoC