minibytes/lib.rs
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8//! # minibytes
9//!
10//! This create provides the [`Bytes`] type. It is similar to `&[u8]`: cloning
11//! or slicing are zero-copy. Unlike `&[u8]`, `Bytes` does not have lifetime.
12//! This is done by maintaining the life cycle of the underlying storage using
13//! reference count.
14//!
15//! Aside from supporting `Vec<u8>` as the underlying storage, [`Bytes`] also
16//! supports [`memmap2::Mmap`]. Libraries can implement [`BytesOwner`] for other
17//! types to further extend storage support.
18
19mod bytes;
20mod impls;
21mod owners;
22mod serde;
23mod text;
24
25#[cfg(test)]
26mod tests;
27
28pub use text::Text;
29pub use text::TextOwner;
30
31pub use crate::bytes::Bytes;
32pub use crate::bytes::BytesOwner;
33pub use crate::bytes::WeakBytes;