ferron/
listener_handler_communication.rs

1use std::net::SocketAddr;
2
3/// Connection data sent from the listener to the handler
4pub struct ConnectionData {
5  pub connection: Connection,
6  pub client_address: SocketAddr,
7  pub server_address: SocketAddr,
8}
9
10/// Connection sent from the listener to the handler
11#[allow(clippy::large_enum_variant)]
12pub enum Connection {
13  /// TCP connection
14  #[cfg(feature = "runtime-monoio")]
15  Tcp(std::net::TcpStream),
16
17  /// TCP connection
18  #[cfg(feature = "runtime-tokio")]
19  Tcp(tokio::net::TcpStream),
20
21  /// QUIC incoming connection
22  Quic(quinn::Incoming),
23}