#byte #owned #abstracting #zero-copy #extensible #life-cycle #mmap

yanked dynbytes

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

1 unstable release

0.1.0 Jun 19, 2024

#17 in #abstracting

MIT license

14KB
295 lines

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.


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.

Dependencies

~215KB