Skip to main content

IntermediaryConnection

Struct IntermediaryConnection 

Source
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,

Source

pub const fn target(&self) -> &ConnectTarget

Returns the authoritative destination selected for the client component.

Source

pub const fn state(&self) -> &State

Returns the single caller-owned state shared by all three middleware layers.

Source

pub const fn cancellation_key(&self) -> Option<&CancelKey>

Returns the proxy-issued cancellation key for this live session.

Source

pub fn detach_cancellation(&mut self) -> Option<CancellationRoute>

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,

Source

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.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation = RejectCancellation> !Freeze for IntermediaryConnection<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation>

§

impl<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation = RejectCancellation> !RefUnwindSafe for IntermediaryConnection<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation>

§

impl<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation = RejectCancellation> !UnwindSafe for IntermediaryConnection<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation>

§

impl<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation> Send for IntermediaryConnection<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation>
where State: Send, Boundary: Send, Cancellation: Send, ServerHandler: Send, ClientHandler: Send, Policy: Send, Peer: Send, ServerIdentity: Send, ClientEvidence: Send, UT: Send, DT: Send,

§

impl<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation> Sync for IntermediaryConnection<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation>
where State: Sync, Boundary: Sync, Cancellation: Sync, ServerHandler: Sync, ClientHandler: Sync, Policy: Sync, Peer: Sync, ServerIdentity: Sync, ClientEvidence: Sync, UT: Sync, DT: Sync,

§

impl<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation> Unpin for IntermediaryConnection<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation>
where State: Unpin, Boundary: Unpin, Cancellation: Unpin, ServerHandler: Unpin, ClientHandler: Unpin, Policy: Unpin, Peer: Unpin, ServerIdentity: Unpin, ClientEvidence: Unpin, UT: Unpin,

§

impl<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation> UnsafeUnpin for IntermediaryConnection<DT, UT, State, Peer, ServerIdentity, ClientEvidence, ServerHandler, ClientHandler, Boundary, Policy, Cancellation>
where State: UnsafeUnpin, Boundary: UnsafeUnpin, Cancellation: UnsafeUnpin, ServerHandler: UnsafeUnpin, ClientHandler: UnsafeUnpin, Policy: UnsafeUnpin, Peer: UnsafeUnpin, ServerIdentity: UnsafeUnpin, ClientEvidence: UnsafeUnpin, UT: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.