Struct Bridge
pub struct Bridge<Ingress, Egress> {
pub ingress: Ingress,
pub egress: Egress,
}std only.Expand description
Two established sides joined by a relay.
The ingress side faces the client, the egress side faces the server. In a peer to peer topology both sides are equal nodes and those names are only a direction convention.
Each side carries a marker naming its kind: ByteIo, QuicIo,
MessageIo or DatagramIo. A Service can therefore serve several
side kinds, and mixes such as a byte ingress with a quic egress, without its
impls overlapping.
The leaf layer that establishes the second side is the one that wraps both
sides, with Self::io, Self::quic, Self::messages or
Self::datagrams. Layers in between pass the bridge on unchanged.
Markers are transparent: each one derefs to the value it wraps and forwards the traits of its kind, so a side is used where its inner value was.
ExtensionsRef reads the ingress side, as a flow keeps moving from
ingress to egress until the relay starts to move data. Read the egress
extensions explicitly where you need them.
Fields§
§ingress: IngressThe side facing the client.
egress: EgressThe side facing the server.
Implementations§
§impl<Ingress, Egress> Bridge<DatagramIo<Ingress>, DatagramIo<Egress>>
impl<Ingress, Egress> Bridge<DatagramIo<Ingress>, DatagramIo<Egress>>
pub const fn datagrams(
ingress: Ingress,
egress: Egress,
) -> Bridge<DatagramIo<Ingress>, DatagramIo<Egress>>
pub const fn datagrams( ingress: Ingress, egress: Egress, ) -> Bridge<DatagramIo<Ingress>, DatagramIo<Egress>>
Bridge two datagram sockets, see DatagramIo.
Trait Implementations§
§impl<Ingress, Egress> DatagramPeekInput for Bridge<DatagramIo<Ingress>, DatagramIo<Egress>>where
Ingress: DatagramSocket,
Egress: Send + 'static,
impl<Ingress, Egress> DatagramPeekInput for Bridge<DatagramIo<Ingress>, DatagramIo<Egress>>where
Ingress: DatagramSocket,
Egress: Send + 'static,
§type Mapped<Peeked: DatagramSocket> = Bridge<DatagramIo<Peeked>, DatagramIo<Egress>>
type Mapped<Peeked: DatagramSocket> = Bridge<DatagramIo<Peeked>, DatagramIo<Egress>>
PrefixedDatagramSocket.§fn peek_socket_mut(
&mut self,
) -> &mut <Bridge<DatagramIo<Ingress>, DatagramIo<Egress>> as DatagramPeekInput>::Socket
fn peek_socket_mut( &mut self, ) -> &mut <Bridge<DatagramIo<Ingress>, DatagramIo<Egress>> as DatagramPeekInput>::Socket
§fn into_peek_socket(
self,
) -> <Bridge<DatagramIo<Ingress>, DatagramIo<Egress>> as DatagramPeekInput>::Socket
fn into_peek_socket( self, ) -> <Bridge<DatagramIo<Ingress>, DatagramIo<Egress>> as DatagramPeekInput>::Socket
§fn map_peek_socket<Peeked, F>(
self,
map: F,
) -> <Bridge<DatagramIo<Ingress>, DatagramIo<Egress>> as DatagramPeekInput>::Mapped<Peeked>where
Peeked: DatagramSocket,
F: FnOnce(<Bridge<DatagramIo<Ingress>, DatagramIo<Egress>> as DatagramPeekInput>::Socket) -> Peeked,
fn map_peek_socket<Peeked, F>(
self,
map: F,
) -> <Bridge<DatagramIo<Ingress>, DatagramIo<Egress>> as DatagramPeekInput>::Mapped<Peeked>where
Peeked: DatagramSocket,
F: FnOnce(<Bridge<DatagramIo<Ingress>, DatagramIo<Egress>> as DatagramPeekInput>::Socket) -> Peeked,
map’s result for its peeked socket.§impl<Ingress, Egress> ExtensionsRef for Bridge<Ingress, Egress>where
Ingress: ExtensionsRef,
impl<Ingress, Egress> ExtensionsRef for Bridge<Ingress, Egress>where
Ingress: ExtensionsRef,
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Extensions store§impl<Ingress, Egress> PeekIoProvider for Bridge<ByteIo<Ingress>, ByteIo<Egress>>
impl<Ingress, Egress> PeekIoProvider for Bridge<ByteIo<Ingress>, ByteIo<Egress>>
§type PeekEgressIo = Egress
type PeekEgressIo = Egress
NoPeekEgress when there is none.§type Mapped<PeekedIngress: Io, PeekedEgress: Io> = Bridge<ByteIo<PeekedIngress>, ByteIo<PeekedEgress>>
type Mapped<PeekedIngress: Io, PeekedEgress: Io> = Bridge<ByteIo<PeekedIngress>, ByteIo<PeekedEgress>>
Self type produced as a result of
mapping the PeekIo and PeekEgressIo types.§fn peek_ios_mut(
&mut self,
) -> (&mut <Bridge<ByteIo<Ingress>, ByteIo<Egress>> as PeekIoProvider>::PeekIo, Option<&mut <Bridge<ByteIo<Ingress>, ByteIo<Egress>> as PeekIoProvider>::PeekEgressIo>)
fn peek_ios_mut( &mut self, ) -> (&mut <Bridge<ByteIo<Ingress>, ByteIo<Egress>> as PeekIoProvider>::PeekIo, Option<&mut <Bridge<ByteIo<Ingress>, ByteIo<Egress>> as PeekIoProvider>::PeekEgressIo>)
§fn map_peek_io<PeekedIngress, PeekedEgress, F, G>(
self,
map: F,
map_egress: G,
) -> <Bridge<ByteIo<Ingress>, ByteIo<Egress>> as PeekIoProvider>::Mapped<PeekedIngress, PeekedEgress>where
PeekedIngress: Io,
PeekedEgress: Io,
F: FnOnce(<Bridge<ByteIo<Ingress>, ByteIo<Egress>> as PeekIoProvider>::PeekIo) -> PeekedIngress,
G: FnOnce(<Bridge<ByteIo<Ingress>, ByteIo<Egress>> as PeekIoProvider>::PeekEgressIo) -> PeekedEgress,
fn map_peek_io<PeekedIngress, PeekedEgress, F, G>(
self,
map: F,
map_egress: G,
) -> <Bridge<ByteIo<Ingress>, ByteIo<Egress>> as PeekIoProvider>::Mapped<PeekedIngress, PeekedEgress>where
PeekedIngress: Io,
PeekedEgress: Io,
F: FnOnce(<Bridge<ByteIo<Ingress>, ByteIo<Egress>> as PeekIoProvider>::PeekIo) -> PeekedIngress,
G: FnOnce(<Bridge<ByteIo<Ingress>, ByteIo<Egress>> as PeekIoProvider>::PeekEgressIo) -> PeekedEgress,
self
by mapping the peeked ingress and egress, usually with the
peeked data in-memory as prefix. Read more§impl<Issuer, Inner, Ingress, Egress> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for TlsMitmRelayService<Issuer, Inner>where
Issuer: BoringMitmCertIssuer,
<Issuer as BoringMitmCertIssuer>::Error: Into<Box<dyn Error + Sync + Send>>,
Inner: Service<Bridge<ByteIo<TlsStream<Ingress>>, ByteIo<TlsStream<Egress>>>>,
<Inner as Service<Bridge<ByteIo<TlsStream<Ingress>>, ByteIo<TlsStream<Egress>>>>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
impl<Issuer, Inner, Ingress, Egress> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for TlsMitmRelayService<Issuer, Inner>where
Issuer: BoringMitmCertIssuer,
<Issuer as BoringMitmCertIssuer>::Error: Into<Box<dyn Error + Sync + Send>>,
Inner: Service<Bridge<ByteIo<TlsStream<Ingress>>, ByteIo<TlsStream<Egress>>>>,
<Inner as Service<Bridge<ByteIo<TlsStream<Ingress>>, ByteIo<TlsStream<Egress>>>>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
§type Error = TlsMitmRelayError
type Error = TlsMitmRelayError
§async fn serve(
&self,
input: Bridge<ByteIo<Ingress>, ByteIo<Egress>>,
) -> Result<<TlsMitmRelayService<Issuer, Inner> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <TlsMitmRelayService<Issuer, Inner> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
async fn serve( &self, input: Bridge<ByteIo<Ingress>, ByteIo<Egress>>, ) -> Result<<TlsMitmRelayService<Issuer, Inner> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <TlsMitmRelayService<Issuer, Inner> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<Ingress, Egress, M, P> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for HttpMitmRelay<M, P>where
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>): Layer<HttpClientService<Body>> + Clone,
<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<HttpClientService<Body>>>::Service: Service<Request, Output = Response> + Clone,
<<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<HttpClientService<Body>>>::Service as Service<Request>>::Error: Into<Box<dyn Error + Sync + Send>>,
M: Send + Sync + 'static + Clone,
P: Matcher<Request> + Clone,
impl<Ingress, Egress, M, P> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for HttpMitmRelay<M, P>where
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>): Layer<HttpClientService<Body>> + Clone,
<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<HttpClientService<Body>>>::Service: Service<Request, Output = Response> + Clone,
<<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<HttpClientService<Body>>>::Service as Service<Request>>::Error: Into<Box<dyn Error + Sync + Send>>,
M: Send + Sync + 'static + Clone,
P: Matcher<Request> + Clone,
§async fn serve(
&self,
__arg1: Bridge<ByteIo<Ingress>, ByteIo<Egress>>,
) -> Result<<HttpMitmRelay<M, P> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <HttpMitmRelay<M, P> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
async fn serve( &self, __arg1: Bridge<ByteIo<Ingress>, ByteIo<Egress>>, ) -> Result<<HttpMitmRelay<M, P> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <HttpMitmRelay<M, P> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<S, Ingress, Egress> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for WebSocketRelayIoService<S>where
S: Service<Bridge<MessageIo<AsyncWebSocket<Ingress>>, MessageIo<AsyncWebSocket<Egress>>>>,
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
impl<S, Ingress, Egress> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for WebSocketRelayIoService<S>where
S: Service<Bridge<MessageIo<AsyncWebSocket<Ingress>>, MessageIo<AsyncWebSocket<Egress>>>>,
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
§type Output = <S as Service<Bridge<MessageIo<AsyncWebSocket<Ingress>>, MessageIo<AsyncWebSocket<Egress>>>>>::Output
type Output = <S as Service<Bridge<MessageIo<AsyncWebSocket<Ingress>>, MessageIo<AsyncWebSocket<Egress>>>>>::Output
§type Error = <S as Service<Bridge<MessageIo<AsyncWebSocket<Ingress>>, MessageIo<AsyncWebSocket<Egress>>>>>::Error
type Error = <S as Service<Bridge<MessageIo<AsyncWebSocket<Ingress>>, MessageIo<AsyncWebSocket<Egress>>>>>::Error
§async fn serve(
&self,
bridge: Bridge<ByteIo<Ingress>, ByteIo<Egress>>,
) -> Result<<WebSocketRelayIoService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <WebSocketRelayIoService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
async fn serve( &self, bridge: Bridge<ByteIo<Ingress>, ByteIo<Egress>>, ) -> Result<<WebSocketRelayIoService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <WebSocketRelayIoService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<S, Ingress, Egress> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for WebSocketRelayService<S>where
S: Service<WebSocketRelayInput>,
<S as Service<WebSocketRelayInput>>::Output: Into<WebSocketRelayOutput>,
<S as Service<WebSocketRelayInput>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
impl<S, Ingress, Egress> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for WebSocketRelayService<S>where
S: Service<WebSocketRelayInput>,
<S as Service<WebSocketRelayInput>>::Output: Into<WebSocketRelayOutput>,
<S as Service<WebSocketRelayInput>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
§async fn serve(
&self,
bridge: Bridge<ByteIo<Ingress>, ByteIo<Egress>>,
) -> Result<<WebSocketRelayService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <WebSocketRelayService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
async fn serve( &self, bridge: Bridge<ByteIo<Ingress>, ByteIo<Egress>>, ) -> Result<<WebSocketRelayService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <WebSocketRelayService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<S, Ingress, Egress> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for WebSocketRelayEventService<S>where
S: Service<WebSocketRelayEventInput>,
<S as Service<WebSocketRelayEventInput>>::Output: Into<WebSocketRelayEventOutput>,
<S as Service<WebSocketRelayEventInput>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
impl<S, Ingress, Egress> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for WebSocketRelayEventService<S>where
S: Service<WebSocketRelayEventInput>,
<S as Service<WebSocketRelayEventInput>>::Output: Into<WebSocketRelayEventOutput>,
<S as Service<WebSocketRelayEventInput>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
§async fn serve(
&self,
bridge: Bridge<ByteIo<Ingress>, ByteIo<Egress>>,
) -> Result<<WebSocketRelayEventService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <WebSocketRelayEventService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
async fn serve( &self, bridge: Bridge<ByteIo<Ingress>, ByteIo<Egress>>, ) -> Result<<WebSocketRelayEventService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <WebSocketRelayEventService<S> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<I, F, Ingress, Egress> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for Socks5MitmRelayService<I, F>where
I: Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>,
<I as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error: Into<Box<dyn Error + Sync + Send>>,
F: Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>,
<F as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
impl<I, F, Ingress, Egress> Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>> for Socks5MitmRelayService<I, F>where
I: Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>,
<I as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error: Into<Box<dyn Error + Sync + Send>>,
F: Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>,
<F as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: Io + Unpin + ExtensionsRef,
Egress: Io + Unpin + ExtensionsRef,
§async fn serve(
&self,
__arg1: Bridge<ByteIo<Ingress>, ByteIo<Egress>>,
) -> Result<<Socks5MitmRelayService<I, F> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <Socks5MitmRelayService<I, F> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
async fn serve( &self, __arg1: Bridge<ByteIo<Ingress>, ByteIo<Egress>>, ) -> Result<<Socks5MitmRelayService<I, F> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Output, <Socks5MitmRelayService<I, F> as Service<Bridge<ByteIo<Ingress>, ByteIo<Egress>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<L, R> Service<Bridge<ByteIo<L>, ByteIo<R>>> for HttpDatagramRelay
impl<L, R> Service<Bridge<ByteIo<L>, ByteIo<R>>> for HttpDatagramRelay
§type Output = DatagramRelayOutcome
type Output = DatagramRelayOutcome
§type Error = SessionError
type Error = SessionError
§fn serve(
&self,
_: Bridge<ByteIo<L>, ByteIo<R>>,
) -> impl Future<Output = Result<<HttpDatagramRelay as Service<Bridge<ByteIo<L>, ByteIo<R>>>>::Output, <HttpDatagramRelay as Service<Bridge<ByteIo<L>, ByteIo<R>>>>::Error>> + Send
fn serve( &self, _: Bridge<ByteIo<L>, ByteIo<R>>, ) -> impl Future<Output = Result<<HttpDatagramRelay as Service<Bridge<ByteIo<L>, ByteIo<R>>>>::Output, <HttpDatagramRelay as Service<Bridge<ByteIo<L>, ByteIo<R>>>>::Error>> + Send
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<S, T> Service<Bridge<ByteIo<S>, ByteIo<T>>> for IoForwardService
impl<S, T> Service<Bridge<ByteIo<S>, ByteIo<T>>> for IoForwardService
§type Output = IoForwardOutcome
type Output = IoForwardOutcome
§type Error = IoForwardError
type Error = IoForwardError
§async fn serve(
&self,
__arg1: Bridge<ByteIo<S>, ByteIo<T>>,
) -> Result<<IoForwardService as Service<Bridge<ByteIo<S>, ByteIo<T>>>>::Output, <IoForwardService as Service<Bridge<ByteIo<S>, ByteIo<T>>>>::Error>
async fn serve( &self, __arg1: Bridge<ByteIo<S>, ByteIo<T>>, ) -> Result<<IoForwardService as Service<Bridge<ByteIo<S>, ByteIo<T>>>>::Output, <IoForwardService as Service<Bridge<ByteIo<S>, ByteIo<T>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<A, B> Service<Bridge<DatagramIo<A>, DatagramIo<B>>> for DatagramForwardServicewhere
A: DatagramSocket,
B: DatagramSocket,
Forward between two connected sockets, as Peer::connected makes them: a
DatagramToProxyBridge association, for example.
impl<A, B> Service<Bridge<DatagramIo<A>, DatagramIo<B>>> for DatagramForwardServicewhere
A: DatagramSocket,
B: DatagramSocket,
Forward between two connected sockets, as Peer::connected makes them: a
DatagramToProxyBridge association, for example.
§type Error = DatagramForwardError
type Error = DatagramForwardError
§async fn serve(
&self,
__arg1: Bridge<DatagramIo<A>, DatagramIo<B>>,
) -> Result<(), <DatagramForwardService as Service<Bridge<DatagramIo<A>, DatagramIo<B>>>>::Error>
async fn serve( &self, __arg1: Bridge<DatagramIo<A>, DatagramIo<B>>, ) -> Result<(), <DatagramForwardService as Service<Bridge<DatagramIo<A>, DatagramIo<B>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<A, B> Service<Bridge<DatagramIo<A>, DatagramIo<B>>> for ConnectUdpRelaywhere
A: DatagramSocket,
B: DatagramSocket,
impl<A, B> Service<Bridge<DatagramIo<A>, DatagramIo<B>>> for ConnectUdpRelaywhere
A: DatagramSocket,
B: DatagramSocket,
§impl<A, B> Service<Bridge<DatagramIo<Peer<A>>, DatagramIo<Peer<B>>>> for DatagramForwardServicewhere
A: DatagramSocket,
B: DatagramSocket,
impl<A, B> Service<Bridge<DatagramIo<Peer<A>>, DatagramIo<Peer<B>>>> for DatagramForwardServicewhere
A: DatagramSocket,
B: DatagramSocket,
§async fn serve(
&self,
__arg1: Bridge<DatagramIo<Peer<A>>, DatagramIo<Peer<B>>>,
) -> Result<(), DatagramForwardError>
async fn serve( &self, __arg1: Bridge<DatagramIo<Peer<A>>, DatagramIo<Peer<B>>>, ) -> Result<(), DatagramForwardError>
Forward both directions. A closed destination drains the sibling for at most the close timeout; a closed receive side ends the association after its buffered input. Other I/O or preservation errors cancel both directions. Dropping the future drops its socket owners and pending send handles. Apply association admission, idle expiration and shutdown in the caller.
§type Error = DatagramForwardError
type Error = DatagramForwardError
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<A, B, T, EA, EB> Service<Bridge<MessageIo<A>, MessageIo<B>>> for StreamForwardService
impl<A, B, T, EA, EB> Service<Bridge<MessageIo<A>, MessageIo<B>>> for StreamForwardService
§type Output = BridgeCloseReason
type Output = BridgeCloseReason
§async fn serve(
&self,
__arg1: Bridge<MessageIo<A>, MessageIo<B>>,
) -> Result<<StreamForwardService as Service<Bridge<MessageIo<A>, MessageIo<B>>>>::Output, <StreamForwardService as Service<Bridge<MessageIo<A>, MessageIo<B>>>>::Error>
async fn serve( &self, __arg1: Bridge<MessageIo<A>, MessageIo<B>>, ) -> Result<<StreamForwardService as Service<Bridge<MessageIo<A>, MessageIo<B>>>>::Output, <StreamForwardService as Service<Bridge<MessageIo<A>, MessageIo<B>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<S, Ingress, Egress> Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>> for WebSocketRelayService<S>where
S: Service<WebSocketRelayInput>,
<S as Service<WebSocketRelayInput>>::Output: Into<WebSocketRelayOutput>,
<S as Service<WebSocketRelayInput>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: WebSocketIo,
Egress: WebSocketIo,
impl<S, Ingress, Egress> Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>> for WebSocketRelayService<S>where
S: Service<WebSocketRelayInput>,
<S as Service<WebSocketRelayInput>>::Output: Into<WebSocketRelayOutput>,
<S as Service<WebSocketRelayInput>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: WebSocketIo,
Egress: WebSocketIo,
§async fn serve(
&self,
__arg1: Bridge<MessageIo<Ingress>, MessageIo<Egress>>,
) -> Result<<WebSocketRelayService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Output, <WebSocketRelayService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Error>
async fn serve( &self, __arg1: Bridge<MessageIo<Ingress>, MessageIo<Egress>>, ) -> Result<<WebSocketRelayService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Output, <WebSocketRelayService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<S, Ingress, Egress> Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>> for WebSocketRelayEventService<S>where
S: Service<WebSocketRelayEventInput>,
<S as Service<WebSocketRelayEventInput>>::Output: Into<WebSocketRelayEventOutput>,
<S as Service<WebSocketRelayEventInput>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: WebSocketIo,
Egress: WebSocketIo,
impl<S, Ingress, Egress> Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>> for WebSocketRelayEventService<S>where
S: Service<WebSocketRelayEventInput>,
<S as Service<WebSocketRelayEventInput>>::Output: Into<WebSocketRelayEventOutput>,
<S as Service<WebSocketRelayEventInput>>::Error: Into<Box<dyn Error + Sync + Send>>,
Ingress: WebSocketIo,
Egress: WebSocketIo,
§async fn serve(
&self,
__arg1: Bridge<MessageIo<Ingress>, MessageIo<Egress>>,
) -> Result<<WebSocketRelayEventService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Output, <WebSocketRelayEventService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Error>
async fn serve( &self, __arg1: Bridge<MessageIo<Ingress>, MessageIo<Egress>>, ) -> Result<<WebSocketRelayEventService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Output, <WebSocketRelayEventService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<Inner, Ingress, Egress> Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>> for HARWebSocketService<Inner>where
Inner: Service<Bridge<MessageIo<HARWebSocket<Ingress>>, MessageIo<HARWebSocket<Egress>>>>,
Ingress: WebSocketIo,
Egress: WebSocketIo,
impl<Inner, Ingress, Egress> Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>> for HARWebSocketService<Inner>where
Inner: Service<Bridge<MessageIo<HARWebSocket<Ingress>>, MessageIo<HARWebSocket<Egress>>>>,
Ingress: WebSocketIo,
Egress: WebSocketIo,
§type Output = <Inner as Service<Bridge<MessageIo<HARWebSocket<Ingress>>, MessageIo<HARWebSocket<Egress>>>>>::Output
type Output = <Inner as Service<Bridge<MessageIo<HARWebSocket<Ingress>>, MessageIo<HARWebSocket<Egress>>>>>::Output
§type Error = <Inner as Service<Bridge<MessageIo<HARWebSocket<Ingress>>, MessageIo<HARWebSocket<Egress>>>>>::Error
type Error = <Inner as Service<Bridge<MessageIo<HARWebSocket<Ingress>>, MessageIo<HARWebSocket<Egress>>>>>::Error
§async fn serve(
&self,
__arg1: Bridge<MessageIo<Ingress>, MessageIo<Egress>>,
) -> Result<<HARWebSocketService<Inner> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Output, <HARWebSocketService<Inner> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Error>
async fn serve( &self, __arg1: Bridge<MessageIo<Ingress>, MessageIo<Egress>>, ) -> Result<<HARWebSocketService<Inner> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Output, <HARWebSocketService<Inner> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<S, Ingress, Egress> Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>> for CaptureWebSocketService<S>where
S: Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>,
Ingress: ExtensionsRef + Send + 'static,
Egress: ExtensionsRef + Send + 'static,
impl<S, Ingress, Egress> Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>> for CaptureWebSocketService<S>where
S: Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>,
Ingress: ExtensionsRef + Send + 'static,
Egress: ExtensionsRef + Send + 'static,
§type Output = <S as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Output
type Output = <S as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Output
§type Error = <S as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Error
type Error = <S as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Error
§async fn serve(
&self,
bridge: Bridge<MessageIo<Ingress>, MessageIo<Egress>>,
) -> Result<<CaptureWebSocketService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Output, <CaptureWebSocketService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Error>
async fn serve( &self, bridge: Bridge<MessageIo<Ingress>, MessageIo<Egress>>, ) -> Result<<CaptureWebSocketService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Output, <CaptureWebSocketService<S> as Service<Bridge<MessageIo<Ingress>, MessageIo<Egress>>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>> for QuicRelay
impl Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>> for QuicRelay
§fn serve(
&self,
_: Bridge<QuicIo<Connection>, QuicIo<Connection>>,
) -> impl Future<Output = Result<(), Box<dyn Error + Sync + Send>>> + Send
fn serve( &self, _: Bridge<QuicIo<Connection>, QuicIo<Connection>>, ) -> impl Future<Output = Result<(), Box<dyn Error + Sync + Send>>> + Send
Relay dedicated, established connections until either connection ends.
ingress is a server connection and egress a client connection.
Both hops must negotiate the same nonempty ALPN. Do not consume their
streams or datagrams concurrently elsewhere. Configure receive datagram
advertisements to match this policy before establishing either hop. Neither
hop may have enabled early-data keys: this generic relay does not decide
application replay safety. Configure TLS early data off on both hops.
Dropping this future closes both connections, including streams waiting
for remote credit. Connection-level transport errors are returned locally
and mapped to failure_code on the other hop; they are not fabricated as
transport errors belonging to that independent connection.
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<S> Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>> for QuicMigrationService<S>where
S: Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>>,
<S as Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>>>::Error: Into<Box<dyn Error + Sync + Send>>,
impl<S> Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>> for QuicMigrationService<S>where
S: Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>>,
<S as Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>>>::Error: Into<Box<dyn Error + Sync + Send>>,
§type Output = <S as Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>>>::Output
type Output = <S as Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>>>::Output
§async fn serve(
&self,
input: Bridge<QuicIo<Connection>, QuicIo<Connection>>,
) -> Result<<QuicMigrationService<S> as Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>>>::Output, Box<dyn Error + Sync + Send>>
async fn serve( &self, input: Bridge<QuicIo<Connection>, QuicIo<Connection>>, ) -> Result<<QuicMigrationService<S> as Service<Bridge<QuicIo<Connection>, QuicIo<Connection>>>>::Output, Box<dyn Error + Sync + Send>>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
§impl<I, E, M, P, D> Service<Bridge<QuicIo<I>, QuicIo<E>>> for Http3MitmRelay<M, P, D>where
I: Connection,
E: ReserveBiStreams,
(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>): Layer<Http3EgressService<E>> + Clone,
<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<Http3EgressService<E>>>::Service: Service<Request, Output = Response> + Clone,
<<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<Http3EgressService<E>>>::Service as Service<Request>>::Error: Into<Box<dyn Error + Sync + Send>>,
M: Send + Sync + 'static + Clone,
P: Matcher<Request> + Clone,
D: Service<Bridge<ByteIo<Upgraded>, ByteIo<Upgraded>>> + Clone,
<D as Service<Bridge<ByteIo<Upgraded>, ByteIo<Upgraded>>>>::Error: Into<Box<dyn Error + Sync + Send>>,
impl<I, E, M, P, D> Service<Bridge<QuicIo<I>, QuicIo<E>>> for Http3MitmRelay<M, P, D>where
I: Connection,
E: ReserveBiStreams,
(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>): Layer<Http3EgressService<E>> + Clone,
<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<Http3EgressService<E>>>::Service: Service<Request, Output = Response> + Clone,
<<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<Http3EgressService<E>>>::Service as Service<Request>>::Error: Into<Box<dyn Error + Sync + Send>>,
M: Send + Sync + 'static + Clone,
P: Matcher<Request> + Clone,
D: Service<Bridge<ByteIo<Upgraded>, ByteIo<Upgraded>>> + Clone,
<D as Service<Bridge<ByteIo<Upgraded>, ByteIo<Upgraded>>>>::Error: Into<Box<dyn Error + Sync + Send>>,
Auto Trait Implementations§
impl<Ingress, Egress> Forget for Bridge<Ingress, Egress>
impl<Ingress, Egress> Freeze for Bridge<Ingress, Egress>
impl<Ingress, Egress> Move for Bridge<Ingress, Egress>
impl<Ingress, Egress> RefUnwindSafe for Bridge<Ingress, Egress>where
Ingress: RefUnwindSafe,
Egress: RefUnwindSafe,
impl<Ingress, Egress> Send for Bridge<Ingress, Egress>
impl<Ingress, Egress> Sync for Bridge<Ingress, Egress>
impl<Ingress, Egress> Unpin for Bridge<Ingress, Egress>
impl<Ingress, Egress> UnsafeUnpin for Bridge<Ingress, Egress>where
Ingress: UnsafeUnpin,
Egress: UnsafeUnpin,
impl<Ingress, Egress> UnwindSafe for Bridge<Ingress, Egress>where
Ingress: UnwindSafe,
Egress: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> ForwardedClientExt for Twhere
T: ExtensionsRef + ?Sized,
impl<T> ForwardedClientExt for Twhere
T: ExtensionsRef + ?Sized,
§fn trusted_forwarded(&self) -> Option<&Forwarded>
fn trusted_forwarded(&self) -> Option<&Forwarded>
§fn forwarded_client(&self) -> Option<&ForwardedElement>
fn forwarded_client(&self) -> Option<&ForwardedElement>
§fn forwarded_client_ip(&self) -> Option<IpAddr>
fn forwarded_client_ip(&self) -> Option<IpAddr>
for node.§fn forwarded_client_socket_addr(&self) -> Option<SocketAddress>
fn forwarded_client_socket_addr(&self) -> Option<SocketAddress>
for node.§fn forwarded_client_host(&self) -> Option<&ForwardedAuthority>
fn forwarded_client_host(&self) -> Option<&ForwardedAuthority>
§fn forwarded_client_proto(&self) -> Option<ForwardedProtocol>
fn forwarded_client_proto(&self) -> Option<ForwardedProtocol>
§fn forwarded_client_version(&self) -> Option<ForwardedVersion>
fn forwarded_client_version(&self) -> Option<ForwardedVersion>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more