bytes_utils/
lib.rs

1#![doc(test(attr(deny(warnings))))]
2#![warn(missing_docs)]
3#![cfg_attr(all(not(test), not(feature = "std")), no_std)]
4
5//! # Extra utilities for the [bytes] crate.
6//!
7//! The [bytes] crate defines few traits and types to help with high-performance manipulation of
8//! byte arrays. Nevertheless, it is more of an interface-level of library (many other crates
9//! expose its types and traits in their own public interfaces) and therefore tries to be on the
10//! lean side.
11//!
12//! One often wishes for some more auxiliary functionality „around“ these types and that's what
13//! this crate aims to provide.
14//!
15//! ## The content
16//!
17//! * [SegmentedBuf] and [SegmentedSlice] for concatenating multiple buffers into a large one
18//!   without copying the bytes.
19//! * [Str] and [StrMut] are wrappers around [Bytes][bytes::Bytes] and [BytesMut]
20//!   respectively, providing a [String]-like interface. They allow splitting into owned
21//!   sub-slices, similar to how the [Bytes] and [BytesMut] work.
22//!
23//! [Bytes]: bytes::Bytes
24//! [BytesMut]: bytes::BytesMut
25
26extern crate alloc;
27
28mod segmented;
29pub mod string;
30
31pub use segmented::{SegmentedBuf, SegmentedSlice};
32pub use string::{Str, StrMut};