rama_net/stream/
mod.rs

1//! [`Stream`] trait and related utilities.
2
3use tokio::io::{AsyncRead, AsyncWrite};
4
5pub mod matcher;
6
7pub mod layer;
8pub mod service;
9
10mod read;
11#[doc(inline)]
12pub use read::{ChainReader, HeapReader, StackReader};
13
14mod peek;
15#[doc(inline)]
16pub use peek::PeekStream;
17
18pub mod rewind;
19
20/// A stream is a type that implements `AsyncRead`, `AsyncWrite` and `Send`.
21/// This is specific to Rama and is directly linked to the supertraits of `Tokio`.
22pub trait Stream: AsyncRead + AsyncWrite + Send + 'static {}
23
24impl<T> Stream for T where T: AsyncRead + AsyncWrite + Send + 'static {}
25
26mod socket;
27#[doc(inline)]
28pub use socket::{ClientSocketInfo, Socket, SocketInfo};
29
30pub mod dep {
31    //! Dependencies for rama stream modules.
32    //!
33    //! Exported for your convenience.
34
35    pub mod ipnet {
36        //! Re-export of the [`ipnet`] crate.
37        //!
38        //! Types for IPv4 and IPv6 network addresses.
39        //!
40        //! [`ipnet`]: https://docs.rs/ipnet
41
42        #[doc(inline)]
43        pub use ipnet::*;
44    }
45}