Skip to main content

Crate bytesbuf_io

Crate bytesbuf_io 

Source
Expand description

Asynchronous I/O abstractions expressed via bytesbuf types.

These types model byte sources that can be read from (Read trait) and byte sinks that can be written to (Write trait). All operations use byte sequences represented by types from bytesbuf instead of raw byte slices, enabling the level of flexibility required for implementing and using high-performance I/O endpoints that consume or produce byte streams.

All operations are asynchronous and take ownership of the data/buffers passed to them, enabling efficient implementation of high-performance I/O endpoints with zero-copy semantics.

The futures-stream feature enables integration with the futures crate, providing an adapter that exposes a Read implementation as a futures::Stream of byte sequences.

The test-util feature enables additional utilities for testing implementations of types that produce or consume streams of bytes. These are in the testing module.

Modules§

testingtest-util
Utilities for testing code that uses bytesbuf_io abstractions.

Structs§

Error
An error signaled by general-purpose extension logic.
ReadAsFuturesStreamfutures-stream
Adapts a Read implementation to the futures::Stream API.

Enums§

ReadInspectDecision
A flow control decision made during conditional reads.

Traits§

Read
Allows for reading of bytes.
ReadExt
Universal convenience methods built on top of Read.
Write
Allowing for writing of bytes.
WriteExt
Universal convenience methods built on top of Write.

Type Aliases§

Result
A Result that may contain an Error from this crate.