跳到主要内容

Module buf

搜索

Module buf 

Source
展开描述

缓冲区操作工具。

缓冲区(buffer)是任何包含一段字节序列的结构。字节 可能存储在连续内存中,也可能不连续。本模块提供了用于抽象缓冲区的 trait, 以及用于处理缓冲区类型的工具。

§Buf, BufMut

这两个 trait 是抽象处理缓冲区的两个基础 trait。 可以把它们视为字节结构的迭代器。它们通过提供面向字节切片优化的 API, 在性能上优于 Iterator

更多细节请参见 BufBufMut

结构体§

Chain
A Chain sequences two buffers.
IntoIter
Iterator over the bytes contained by the buffer.
Limit
A BufMut adapter which limits the amount of bytes that can be written to an underlying buffer.
Reader
A Buf adapter which implements io::Read for the inner value.
Take
A Buf adapter which limits the bytes read from an underlying buffer.
UninitSlice
Uninitialized byte slice.
Writer
A BufMut adapter which implements io::Write for the inner value.

Trait§

Buf
Read bytes from a buffer.
BufMut
A trait for values that provide sequential write access to bytes.