TODO: `AsyncSource<R>`: Async version of `Source<R>`, and the `AsyncRead` couterpart of `AsyncSink<R>`.
TODO: `Stream<RW>`, `AsyncStream<RW>`: Combines both `Sink<W>` and `Source<R>` for `Read+Write` types (and async counterparts) using the same cipher key.
Fortune for chacha20stream's current commit: Small curse − 小凶
/// The `flush()` implementation *does* clear this buffer.
/// The `flush()` implementation *does* clear this buffer.
/// You can use the `prune()` function to zero out this buffer manually too.
/// You can use the `prune()` function to zero out this buffer manually too.
//#[derive(Debug)]
//#[derive(Debug)]
pubstructSink<W>
pubstructSink<W: ?Sized>
{
{
stream: W,
crypter: Crypter,// for chacha, finalize does nothing it seems. we can also call it multiple times.
crypter: Crypter,// for chacha, finalize does nothing it seems. we can also call it multiple times.
buffer: BufferVec,// used to buffer the operation
buffer: BufferVec,// used to buffer the operation
stream: W,
}
/// TODO: Document
//#[derive(Debug)]
pubstructSource<R>
{
crypter: Crypter,
#[cfg(not(feature="reuse-buffer"))]buffer: BufferVec,// When `reuse-buffer` is enabled, this isn't needed. We re-use the output buffer for the initial read of untransformed data from `stream` and the actual transformation of the read bytes.