#byte #owning #extensible #management #abstracting #type #mmap

anybytes

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

8 releases

new 0.3.0 Sep 4, 2024
0.2.1 Sep 4, 2024
0.1.4 Aug 30, 2024
0.1.2 Jul 9, 2024
0.1.0 Jun 19, 2024

#1 in #abstracting

Download history 172/week @ 2024-06-19 2/week @ 2024-06-26 204/week @ 2024-07-03 112/week @ 2024-07-10 16/week @ 2024-07-17 14/week @ 2024-07-24 15/week @ 2024-07-31 34/week @ 2024-08-07 12/week @ 2024-08-14 350/week @ 2024-08-28

399 downloads per month

MIT license

23KB
654 lines

A small byte management library, that can abstract over various byte owning types, like Vec, bytes::Bytes, or memmap2::Mmap.

Acknowledgements

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


lib.rs:

minibytes

This create provides the Bytes type. It is similar to &[u8]: cloning or slicing are zero-copy. Unlike &[u8], Bytes does not have lifetime. This is done by maintaining the life cycle of the underlying storage using reference count.

Aside from supporting Vec<u8> as the underlying storage, Bytes also supports memmap2::Mmap. Libraries can implement BytesOwner for other types to further extend storage support.

Dependencies

~0–410KB