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

anybytes

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

5 releases (3 breaking)

0.10.0-alpha.1 Oct 21, 2024
0.9.0-alpha.1 Sep 27, 2024
0.1.2 Jul 9, 2024

#487 in Rust patterns

Download history 14/week @ 2024-07-23 14/week @ 2024-07-30 33/week @ 2024-08-06 16/week @ 2024-08-13 358/week @ 2024-08-27 289/week @ 2024-09-03 286/week @ 2024-09-10 353/week @ 2024-09-17 434/week @ 2024-09-24 39/week @ 2024-10-01 17/week @ 2024-10-08 163/week @ 2024-10-15 123/week @ 2024-10-22 7/week @ 2024-10-29 30/week @ 2024-11-05

327 downloads per month
Used in tribles

MIT license

32KB
941 lines

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 Zerocopy Integration mmap support kani verified
anybytes 🚧
bytes
ownedbytes
minibytes ❌[^1]

[^1]: No longer maintained as an individual crate.

Acknowledgements

This library started as a fork of the minibyte library in facebooks sapling scm.

Dependencies

~0.9–1.6MB
~28K SLoC