Struct EagerHttpProxyConnector
pub struct EagerHttpProxyConnector<C, S> { /* private fields */ }http and std only.Expand description
HTTP proxy CONNECT service which establishes the egress connection before acknowledging the CONNECT request.
Register it directly with an UpgradeLayer:
let connect = EagerHttpProxyConnector::new(connector, relay_service);
let layer = UpgradeLayer::new(
executor,
MethodMatcher::CONNECT,
connect,
);A successful response is returned only after connector established the
requested egress connection. The established connection is carried across
the HTTP upgrade and passed to relay_service together with the upgraded
ingress connection as a BridgeIo.
Use
LazyHttpProxyConnectReplyService
together with a handler that establishes its own connection when the CONNECT
request must be acknowledged before an egress connection can be made.
Connection policy belongs in the connector stack. For example, wrap the
connector in a TimeoutLayer to bound the
time spent establishing egress.
Implementations§
§impl<C, S> EagerHttpProxyConnector<C, S>
impl<C, S> EagerHttpProxyConnector<C, S>
pub fn new(connector: C, relay_service: S) -> EagerHttpProxyConnector<C, S>
pub fn new(connector: C, relay_service: S) -> EagerHttpProxyConnector<C, S>
Create an HTTP proxy CONNECT service that establishes egress before replying.
Trait Implementations§
§impl<C, S> Clone for EagerHttpProxyConnector<C, S>
impl<C, S> Clone for EagerHttpProxyConnector<C, S>
§fn clone(&self) -> EagerHttpProxyConnector<C, S>
fn clone(&self) -> EagerHttpProxyConnector<C, S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<C, S> Debug for EagerHttpProxyConnector<C, S>
impl<C, S> Debug for EagerHttpProxyConnector<C, S>
§impl<C, S, Body> Service<Request<Body>> for EagerHttpProxyConnector<C, S>where
C: ConnectorService<ConnectRequest>,
<C as ConnectorService<ConnectRequest>>::Connection: Io + Unpin,
S: Service<BridgeIo<Upgraded, <C as ConnectorService<ConnectRequest>>::Connection>> + Clone,
<S as Service<BridgeIo<Upgraded, <C as ConnectorService<ConnectRequest>>::Connection>>>::Error: Into<Box<dyn Error + Sync + Send>>,
Body: Send + 'static,
impl<C, S, Body> Service<Request<Body>> for EagerHttpProxyConnector<C, S>where
C: ConnectorService<ConnectRequest>,
<C as ConnectorService<ConnectRequest>>::Connection: Io + Unpin,
S: Service<BridgeIo<Upgraded, <C as ConnectorService<ConnectRequest>>::Connection>> + Clone,
<S as Service<BridgeIo<Upgraded, <C as ConnectorService<ConnectRequest>>::Connection>>>::Error: Into<Box<dyn Error + Sync + Send>>,
Body: Send + 'static,
§type Output = UpgradeOutput<Request<Body>, Response>
type Output = UpgradeOutput<Request<Body>, Response>
§async fn serve(
&self,
req: Request<Body>,
) -> Result<<EagerHttpProxyConnector<C, S> as Service<Request<Body>>>::Output, <EagerHttpProxyConnector<C, S> as Service<Request<Body>>>::Error>
async fn serve( &self, req: Request<Body>, ) -> Result<<EagerHttpProxyConnector<C, S> as Service<Request<Body>>>::Output, <EagerHttpProxyConnector<C, S> as Service<Request<Body>>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
Auto Trait Implementations§
impl<C, S> Freeze for EagerHttpProxyConnector<C, S>
impl<C, S> RefUnwindSafe for EagerHttpProxyConnector<C, S>where
C: RefUnwindSafe,
S: RefUnwindSafe,
impl<C, S> Send for EagerHttpProxyConnector<C, S>
impl<C, S> Sync for EagerHttpProxyConnector<C, S>
impl<C, S> Unpin for EagerHttpProxyConnector<C, S>
impl<C, S> UnsafeUnpin for EagerHttpProxyConnector<C, S>where
C: UnsafeUnpin,
S: UnsafeUnpin,
impl<C, S> UnwindSafe for EagerHttpProxyConnector<C, S>where
C: UnwindSafe,
S: 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> 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<S> IntoEndpointService<(S,)> for S
impl<S> IntoEndpointService<(S,)> for S
type Service = S
§fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
rama_core::Service.§impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
type Service = S
§fn into_endpoint_service_with_state(
self,
_state: State,
) -> <S as IntoEndpointServiceWithState<(S,), State>>::Service
fn into_endpoint_service_with_state( self, _state: State, ) -> <S as IntoEndpointServiceWithState<(S,), State>>::Service
rama_core::Service with state.§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