diff --git a/src/stream_async/mod.rs b/src/stream_async/mod.rs index add6495..c59a580 100644 --- a/src/stream_async/mod.rs +++ b/src/stream_async/mod.rs @@ -28,6 +28,9 @@ pub type Error = ErrorStack; pub mod sink; pub use sink::Sink; +pub mod source; +pub use source::Source; + #[cfg(test)] mod test { diff --git a/src/stream_async/sink.rs b/src/stream_async/sink.rs index b925782..b4eded4 100644 --- a/src/stream_async/sink.rs +++ b/src/stream_async/sink.rs @@ -1,4 +1,4 @@ -//! Asyncronous `Write` wrapper. +//! Asyncronous `AsyncWrite` wrapper. use super::*; /// Async ChaCha Sink diff --git a/src/stream_async/source.rs b/src/stream_async/source.rs new file mode 100644 index 0000000..be19735 --- /dev/null +++ b/src/stream_async/source.rs @@ -0,0 +1,14 @@ +//! Asyncronous `AsyncRead` wrapper. +use super::*; + +/// TODO: Document +//#[derive(Debug)] +#[pin_project] +pub struct Source +{ + #[pin] stream: R, + + crypter: Crypter, // for chacha, finalize does nothing it seems. we can also call it multiple times. + + buffer: BufferVec, // used to buffer the operation (ad-hoc-buffer wouldn't work for async operations as the buffer may need to be saved over yields.) +}