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};
13
14/// A stream is a type that implements `AsyncRead`, `AsyncWrite` and `Send`.
15/// This is specific to Rama and is directly linked to the supertraits of `Tokio`.
16pub trait Stream: AsyncRead + AsyncWrite + Send + 'static {}
17
18impl<T> Stream for T where T: AsyncRead + AsyncWrite + Send + 'static {}
19
20mod socket;
21#[doc(inline)]
22pub use socket::{ClientSocketInfo, Socket, SocketInfo};
23
24pub mod dep {
25 //! Dependencies for rama stream modules.
26 //!
27 //! Exported for your convenience.
28
29 pub mod ipnet {
30 //! Re-export of the [`ipnet`] crate.
31 //!
32 //! Types for IPv4 and IPv6 network addresses.
33 //!
34 //! [`ipnet`]: https://docs.rs/ipnet
35
36 #[doc(inline)]
37 pub use ipnet::*;
38 }
39}