rama_core/stream/mod.rs
1use tokio::io::{AsyncRead, AsyncWrite};
2
3mod read;
4#[doc(inline)]
5pub use read::{ChainReader, HeapReader, StackReader};
6
7mod peek;
8#[doc(inline)]
9pub use peek::PeekStream;
10
11pub mod rewind;
12
13pub mod json;
14
15/// A stream is a type that implements `AsyncRead`, `AsyncWrite` and `Send`.
16/// This is specific to Rama and is directly linked to the supertraits of `Tokio`.
17pub trait Stream: AsyncRead + AsyncWrite + Send + 'static {}
18
19impl<T> Stream for T where T: AsyncRead + AsyncWrite + Send + 'static {}
20
21pub mod codec {
22 //! Adaptors from `AsyncRead`/`AsyncWrite` to Stream/Sink
23 //!
24 //! Raw I/O objects work with byte sequences, but higher-level code usually
25 //! wants to batch these into meaningful chunks, called "frames".
26 //!
27 //! Re-export of [`tokio_util::codec`].
28
29 pub use tokio_util::codec::*;
30}
31
32pub mod io {
33 //! Helpers for IO related tasks.
34 //!
35 //! Re-export of [`tokio_util::io`].
36
37 pub use tokio_util::io::*;
38}