trillium_http/connection_status.rs
1use crate::{Conn, Upgrade};
2/// This represents the next state after a response on a conn transport.
3#[derive(Debug)]
4#[allow(
5 clippy::large_enum_variant,
6 reason = "ConnectionStatus::Conn is the hot path, boxing it would add an allocation per \
7 request"
8)]
9pub enum ConnectionStatus<Transport> {
10 /// The transport has been closed, either by the client or by us
11 Close,
12 /// Another `Conn` request has been sent on the same transport and
13 /// is ready to respond to. This can occur any number of times and
14 /// should be handled in a loop.
15 Conn(Conn<Transport>),
16 /// An http upgrade has been negotiated. This is always a terminal
17 /// state for a given connection.
18 Upgrade(Upgrade<Transport>),
19}