#byte #zero-copy #extensible #source #owning #abstracting #different

anybytes

A small library abstracting over bytes owning types in an extensible way

11 releases (7 breaking)

new 0.14.0 Jan 15, 2025
0.12.0 Jan 14, 2025
0.11.0 Dec 15, 2024
0.11.0-alpha.1 Nov 28, 2024
0.1.2 Jul 9, 2024

#542 in Rust patterns

Download history 270/week @ 2024-09-25 30/week @ 2024-10-02 16/week @ 2024-10-09 221/week @ 2024-10-16 64/week @ 2024-10-23 16/week @ 2024-10-30 21/week @ 2024-11-06 2/week @ 2024-11-13 134/week @ 2024-11-20 152/week @ 2024-11-27 49/week @ 2024-12-04 177/week @ 2024-12-11 22/week @ 2024-12-18 3/week @ 2024-12-25 79/week @ 2025-01-08

130 downloads per month
Used in tribles

MIT license

34KB
1K SLoC

This Library is still pre-1.0.0 the API is therefore in heavy flux!

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, Strings and Zerocopy types.

Comparison

Crate Active Extensible mmap support Zerocopy Integration Pyo3 Integration kani verified
anybytes 🚧
bytes
ownedbytes
minibytes ✅[^1]

[^1]: 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

~0.9–2.2MB
~40K SLoC