pub struct Pipe<Front: SocketHandler, L: ListenerHandler> {
pub backend_readiness: Readiness,
pub backend: Option<Rc<RefCell<Backend>>>,
pub container_backend_timeout: Option<TimeoutContainer>,
pub container_frontend_timeout: Option<TimeoutContainer>,
pub frontend_readiness: Readiness,
/* private fields */
}Fields§
§backend_readiness: Readiness§backend: Option<Rc<RefCell<Backend>>>§container_backend_timeout: Option<TimeoutContainer>§container_frontend_timeout: Option<TimeoutContainer>§frontend_readiness: ReadinessImplementations§
Source§impl<Front: SocketHandler, L: ListenerHandler> Pipe<Front, L>
impl<Front: SocketHandler, L: ListenerHandler> Pipe<Front, L>
Sourcepub fn new(
backend_buffer: Checkout,
backend_id: Option<String>,
backend_socket: Option<TcpStream>,
backend: Option<Rc<RefCell<Backend>>>,
container_backend_timeout: Option<TimeoutContainer>,
container_frontend_timeout: Option<TimeoutContainer>,
cluster_id: Option<String>,
frontend_buffer: Checkout,
frontend_token: Token,
frontend: Front,
listener: Rc<RefCell<L>>,
protocol: Protocol,
session_id: Ulid,
request_id: Ulid,
session_address: Option<SocketAddr>,
websocket_context: WebSocketContext,
) -> Pipe<Front, L>
pub fn new( backend_buffer: Checkout, backend_id: Option<String>, backend_socket: Option<TcpStream>, backend: Option<Rc<RefCell<Backend>>>, container_backend_timeout: Option<TimeoutContainer>, container_frontend_timeout: Option<TimeoutContainer>, cluster_id: Option<String>, frontend_buffer: Checkout, frontend_token: Token, frontend: Front, listener: Rc<RefCell<L>>, protocol: Protocol, session_id: Ulid, request_id: Ulid, session_address: Option<SocketAddr>, websocket_context: WebSocketContext, ) -> Pipe<Front, L>
Instantiate a new Pipe SessionState with:
- frontend_interest: READABLE | WRITABLE | HUP | ERROR
- frontend_event: EMPTY
- backend_interest: READABLE | WRITABLE | HUP | ERROR
- backend_event: EMPTY
Remember to set the events from the previous State!
Sourcepub fn set_tls_metadata(
&mut self,
version: Option<&'static str>,
cipher: Option<&'static str>,
sni: Option<String>,
alpn: Option<&'static str>,
)
pub fn set_tls_metadata( &mut self, version: Option<&'static str>, cipher: Option<&'static str>, sni: Option<String>, alpn: Option<&'static str>, )
Stamp connection-scoped TLS metadata captured at handshake time onto
the pipe for access-log emission. Called from the HTTPS→WSS upgrade
path in https.rs::upgrade_mux after the Pipe has been built from
the prior mux HttpContext. Leaves plaintext paths (plain TCP, plain
WS, proxy-protocol) untouched so their access logs continue to emit
None for all TLS fields.
pub fn front_socket(&self) -> &TcpStream
pub fn front_socket_mut(&mut self) -> &mut TcpStream
pub fn back_socket(&self) -> Option<&TcpStream>
pub fn back_socket_mut(&mut self) -> Option<&mut TcpStream>
pub fn set_back_socket(&mut self, socket: TcpStream)
pub fn back_token(&self) -> Vec<Token>
pub fn set_cluster_id(&mut self, cluster_id: Option<String>)
pub fn set_backend_id(&mut self, backend_id: Option<String>)
pub fn set_back_token(&mut self, token: Token)
pub fn get_session_address(&self) -> Option<SocketAddr>
pub fn get_backend_address(&self) -> Option<SocketAddr>
pub fn log_request( &self, metrics: &SessionMetrics, error: bool, message: Option<&str>, )
pub fn log_request_success(&self, metrics: &SessionMetrics)
pub fn log_request_error(&self, metrics: &SessionMetrics, message: &str)
Sourcepub fn log_request_timeout(&self, metrics: &SessionMetrics, message: &str)
pub fn log_request_timeout(&self, metrics: &SessionMetrics, message: &str)
Access-log wrapper for benign idle-timeout tear-downs.
Unlike log_request_error, this path logs at debug! and skips the
state dump — an idle pipe hitting its front/back_timeout is expected
behaviour (e.g. a WebSocket with no keepalive) and should not pollute
the error stream.
Sourcepub fn check_connections(&self) -> bool
pub fn check_connections(&self) -> bool
Wether the session should be kept open, depending on endpoints status and buffer usage (both in memory and in kernel)