pub struct IntermediaryConnection<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation = RejectCancellation> { /* private fields */ }Expand description
One operational, independently authenticated intermediary session.
Implementations§
Source§impl<DT, UT, State, Peer, SI, CE, SH, CH, Boundary, Policy, K> IntermediaryConnection<DT, UT, State, Peer, SI, CE, SH, CH, Boundary, Policy, K>where
Policy: PipelinePolicy,
impl<DT, UT, State, Peer, SI, CE, SH, CH, Boundary, Policy, K> IntermediaryConnection<DT, UT, State, Peer, SI, CE, SH, CH, Boundary, Policy, K>where
Policy: PipelinePolicy,
Sourcepub const fn target(&self) -> &ConnectTarget
pub const fn target(&self) -> &ConnectTarget
Returns the authoritative destination selected for the client component.
Sourcepub const fn state(&self) -> &State
pub const fn state(&self) -> &State
Returns the single caller-owned state shared by all three middleware layers.
Sourcepub const fn cancellation_key(&self) -> Option<&CancelKey>
pub const fn cancellation_key(&self) -> Option<&CancelKey>
Returns the proxy-issued cancellation key for this live session.
Sourcepub fn detach_cancellation(&mut self) -> Option<CancellationRoute>where
K: IntermediaryCancellationRegistry,
pub fn detach_cancellation(&mut self) -> Option<CancellationRoute>where
K: IntermediaryCancellationRegistry,
Detaches this session’s cancellation mapping explicitly.
Source§impl<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, K> IntermediaryConnection<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, K>where
DT: AsyncRead + AsyncWrite + Unpin,
UT: AsyncRead + AsyncWrite + Unpin,
ServerHandler: ServerMiddleware<State, ServerConnectionContext<Peer, ServerIdentity>>,
ClientHandler: ClientMiddleware<State, ClientConnectionContext<ClientEvidence>>,
Boundary: IntermediaryMiddleware<State, ServerConnectionContext<Peer, ServerIdentity>, ClientConnectionContext<ClientEvidence>>,
Policy: PipelinePolicy,
K: IntermediaryCancellationRegistry,
impl<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, K> IntermediaryConnection<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, K>where
DT: AsyncRead + AsyncWrite + Unpin,
UT: AsyncRead + AsyncWrite + Unpin,
ServerHandler: ServerMiddleware<State, ServerConnectionContext<Peer, ServerIdentity>>,
ClientHandler: ClientMiddleware<State, ClientConnectionContext<ClientEvidence>>,
Boundary: IntermediaryMiddleware<State, ServerConnectionContext<Peer, ServerIdentity>, ClientConnectionContext<ClientEvidence>>,
Policy: PipelinePolicy,
K: IntermediaryCancellationRegistry,
Sourcepub async fn forward_frontend(
&mut self,
) -> Result<FrontendMessage, ForwardError>
pub async fn forward_frontend( &mut self, ) -> Result<FrontendMessage, ForwardError>
Receives one legal client message and forwards it upstream in source-role, boundary, destination-role middleware order.
§Errors
Returns transport, framing, protocol-legality, or capacity failures.
Sourcepub async fn forward_backend(&mut self) -> Result<BackendMessage, ForwardError>
pub async fn forward_backend(&mut self) -> Result<BackendMessage, ForwardError>
Receives one legal PostgreSQL response and forwards it downstream in source-role, boundary, destination-role middleware order.
§Errors
Returns transport, framing, ordering, or protocol-legality failures.
Sourcepub async fn forward_next(&mut self) -> Result<ForwardedMessage, ForwardError>
pub async fn forward_next(&mut self) -> Result<ForwardedMessage, ForwardError>
Waits on both transports and forwards whichever legal message becomes available first. This is the duplex driver for asynchronous traffic, COPY BOTH, and physical replication.
When frontend capacity is exhausted, the unchanged pending request is retained and only backend progress is polled until capacity recovers.
§Errors
Returns transport, framing, ordering, protocol-legality, or capacity failures.
Sourcepub fn teardown(
self,
) -> (AcceptedServerTransport<DT>, ClientTransport<UT>, State, Boundary, (ServerHandler, ClientHandler), IntermediaryContexts<ServerConnectionContext<Peer, ServerIdentity>, ClientConnectionContext<ClientEvidence>>)
pub fn teardown( self, ) -> (AcceptedServerTransport<DT>, ClientTransport<UT>, State, Boundary, (ServerHandler, ClientHandler), IntermediaryContexts<ServerConnectionContext<Peer, ServerIdentity>, ClientConnectionContext<ClientEvidence>>)
Deliberately tears down both roles and recovers transports, handlers, contexts, boundary middleware, and the sole connection state.