1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! # Byte Stream Traits
//!
//! Simple trait aliases that let you plug **any async stream of bytes** into this crate.
//! Choose regular `Vec<u8>` or 64-byte aligned `Vec64<u8>` when you care about SIMD.
//!
//! **Why this is useful**
//! - Works with any `futures_core::Stream<Result<_, io::Error>>` (files, sockets, in-memory).
//! - No extra layers or boxing—just trait bounds.
//! - Optional `ByteStream64` avoids re-allocations when you need aligned buffers.
//!
//! Backpressure and scheduling are handled by your underlying stream.
use Stream;
use Vec64;
use io;
/// Universal trait alias for any asynchronous, chunked byte stream.
///
/// Implemented automatically for any [`Stream`] yielding `Result<Vec<u8>, io::Error>`
/// and supporting `Send` + `Unpin`.
/// Universal trait alias for any asynchronous, chunked byte stream of 64-byte aligned buffers.
///
/// This is a special case for scenarios where both the producer and consumer are under
/// your control and SIMD alignment is required end-to-end (e.g. disk or network paths that
/// preserve alignment). Using this avoids later re-allocation purely to fix alignment.
///
/// Implemented automatically for any [`Stream`] yielding `Result<Vec64<u8>, io::Error>`
/// and supporting `Send` + `Unpin`.
/// Generalised trait for any asynchronous, chunked byte stream of the given buffer type `B`.
///
/// This is a pure set of bounds that allows plugging in any compliant `Stream`
/// without dynamic dispatch.
///
/// Implemented for any `Stream<Item = Result<B, io::Error>> + Send + Unpin`.