• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //! Utilities for working with buffers.
2 //!
3 //! A buffer is any structure that contains a sequence of bytes. The bytes may
4 //! or may not be stored in contiguous memory. This module contains traits used
5 //! to abstract over buffers as well as utilities for working with buffer types.
6 //!
7 //! # `Buf`, `BufMut`
8 //!
9 //! These are the two foundational traits for abstractly working with buffers.
10 //! They can be thought as iterators for byte structures. They offer additional
11 //! performance over `Iterator` by providing an API optimized for byte slices.
12 //!
13 //! See [`Buf`] and [`BufMut`] for more details.
14 //!
15 //! [rope]: https://en.wikipedia.org/wiki/Rope_(data_structure)
16 //! [`Buf`]: trait.Buf.html
17 //! [`BufMut`]: trait.BufMut.html
18 
19 mod buf_impl;
20 mod buf_mut;
21 mod chain;
22 mod iter;
23 mod limit;
24 #[cfg(feature = "std")]
25 mod reader;
26 mod take;
27 mod uninit_slice;
28 mod vec_deque;
29 #[cfg(feature = "std")]
30 mod writer;
31 
32 pub use self::buf_impl::Buf;
33 pub use self::buf_mut::BufMut;
34 pub use self::chain::Chain;
35 pub use self::iter::IntoIter;
36 pub use self::limit::Limit;
37 pub use self::take::Take;
38 pub use self::uninit_slice::UninitSlice;
39 
40 #[cfg(feature = "std")]
41 pub use self::{reader::Reader, writer::Writer};
42