pub struct HttpWebSocketRelayServiceRequestMatcher<S = IoForwardService> { /* private fields */ }Expand description
Default matcher that can be used for Http websocket relays.
Request matches for an http websocket request return
a HttpWebSocketRelayServiceResponseMatcher instance which
will match on 101 status code responses…
§Note
This matcher does NOT validate if client <-> server handshake flow is compatible with one another. This in contrast to Rama’s pure client / server implementations, the MITM flow typically should not botter with that, given there are always those odd balls out there which have RFC incompatible definitions of reality. Fork this file if you have more advanced needs… or feel free to make a proposal on improvements to this file while still respecting its spirit.
Implementations§
Source§impl HttpWebSocketRelayServiceRequestMatcher
impl HttpWebSocketRelayServiceRequestMatcher
Sourcepub fn default_with_exec(exec: Executor) -> Self
pub fn default_with_exec(exec: Executor) -> Self
Create a HttpWebSocketRelayServiceRequestMatcher whose default
fallback relay observes graceful shutdown via the given Executor.
Prefer this over Self::default when you have an executor available
— it lets the relay bridge unwind cleanly on shutdown.
Source§impl<S> HttpWebSocketRelayServiceRequestMatcher<S>
impl<S> HttpWebSocketRelayServiceRequestMatcher<S>
Sourcepub fn new(relay_svc: S) -> Self
pub fn new(relay_svc: S) -> Self
Create a new HttpWebSocketRelayServiceRequestMatcher.
Sourcepub fn maybe_with_websocket_config(self, cfg: Option<WebSocketConfig>) -> Self
pub fn maybe_with_websocket_config(self, cfg: Option<WebSocketConfig>) -> Self
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
Sourcepub fn maybe_set_websocket_config(
&mut self,
cfg: Option<WebSocketConfig>,
) -> &mut Self
pub fn maybe_set_websocket_config( &mut self, cfg: Option<WebSocketConfig>, ) -> &mut Self
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
Sourcepub fn with_websocket_config(self, cfg: WebSocketConfig) -> Self
pub fn with_websocket_config(self, cfg: WebSocketConfig) -> Self
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
Sourcepub fn set_websocket_config(&mut self, cfg: WebSocketConfig) -> &mut Self
pub fn set_websocket_config(&mut self, cfg: WebSocketConfig) -> &mut Self
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
Sourcepub fn without_websocket_config(self) -> Self
pub fn without_websocket_config(self) -> Self
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
Sourcepub fn unset_websocket_config(&mut self) -> &mut Self
pub fn unset_websocket_config(&mut self) -> &mut Self
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
Sourcepub fn with_store_handshake_request_header(self, store: bool) -> Self
pub fn with_store_handshake_request_header(self, store: bool) -> Self
Define if the handshake (http) request headers needs to be stored in the Ingress Io extensions.
By default it is not stored.
§Note
It is only stored if requested AND the request is matched.
Sourcepub fn set_store_handshake_request_header(&mut self, store: bool) -> &mut Self
pub fn set_store_handshake_request_header(&mut self, store: bool) -> &mut Self
Define if the handshake (http) request headers needs to be stored in the Ingress Io extensions.
By default it is not stored.
§Note
It is only stored if requested AND the request is matched.
Sourcepub fn with_store_handshake_response_header(self, store: bool) -> Self
pub fn with_store_handshake_response_header(self, store: bool) -> Self
Define if the handshake (http) response headers needs to be stored in the Ingress Io extensions.
By default it is not stored.
§Note
It is only stored if requested AND the response is matched.
Sourcepub fn set_store_handshake_response_header(&mut self, store: bool) -> &mut Self
pub fn set_store_handshake_response_header(&mut self, store: bool) -> &mut Self
Define if the handshake (http) response headers needs to be stored in the Ingress Io extensions.
By default it is not stored.
§Note
It is only stored if requested AND the response is matched.
Trait Implementations§
Source§impl<S: Clone> Clone for HttpWebSocketRelayServiceRequestMatcher<S>
impl<S: Clone> Clone for HttpWebSocketRelayServiceRequestMatcher<S>
Source§impl<S: Debug> Debug for HttpWebSocketRelayServiceRequestMatcher<S>
impl<S: Debug> Debug for HttpWebSocketRelayServiceRequestMatcher<S>
Source§impl<S, Body> ServiceMatcher<Request<Body>> for HttpWebSocketRelayServiceRequestMatcher<S>
impl<S, Body> ServiceMatcher<Request<Body>> for HttpWebSocketRelayServiceRequestMatcher<S>
Source§type Service = HttpWebSocketRelayServiceResponseMatcher<S>
type Service = HttpWebSocketRelayServiceResponseMatcher<S>
Source§type ModifiedInput = Request<Body>
type ModifiedInput = Request<Body>
Source§async fn match_service(
&self,
req: Request<Body>,
) -> Result<ServiceMatch<Self::ModifiedInput, Self::Service>, Self::Error>
async fn match_service( &self, req: Request<Body>, ) -> Result<ServiceMatch<Self::ModifiedInput, Self::Service>, Self::Error>
input.Source§async fn into_match_service(
self,
req: Request<Body>,
) -> Result<ServiceMatch<Self::ModifiedInput, Self::Service>, Self::Error>
async fn into_match_service( self, req: Request<Body>, ) -> Result<ServiceMatch<Self::ModifiedInput, Self::Service>, Self::Error>
input, consuming the matcher. Read moreSource§fn boxed(
self,
) -> BoxServiceMatcher<Input, Self::Service, Self::Error, Self::ModifiedInput>where
Self: Sized,
fn boxed(
self,
) -> BoxServiceMatcher<Input, Self::Service, Self::Error, Self::ModifiedInput>where
Self: Sized,
Auto Trait Implementations§
impl<S> Freeze for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Freeze,
impl<S> RefUnwindSafe for HttpWebSocketRelayServiceRequestMatcher<S>where
S: RefUnwindSafe,
impl<S> Send for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Send,
impl<S> Sync for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Sync,
impl<S> Unpin for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Unpin,
impl<S> UnsafeUnpin for HttpWebSocketRelayServiceRequestMatcher<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for HttpWebSocketRelayServiceRequestMatcher<S>where
S: UnwindSafe,
Blanket Implementations§
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,
Source§impl<Input, T> DynServiceMatcher<Input> for Twhere
T: ServiceMatcher<Input>,
impl<Input, T> DynServiceMatcher<Input> for Twhere
T: ServiceMatcher<Input>,
Source§type Service = <T as ServiceMatcher<Input>>::Service
type Service = <T as ServiceMatcher<Input>>::Service
Source§type Error = <T as ServiceMatcher<Input>>::Error
type Error = <T as ServiceMatcher<Input>>::Error
Source§type ModifiedInput = <T as ServiceMatcher<Input>>::ModifiedInput
type ModifiedInput = <T as ServiceMatcher<Input>>::ModifiedInput
Source§fn match_service_box(
&self,
input: Input,
) -> Pin<Box<dyn Future<Output = Result<ServiceMatch<<T as DynServiceMatcher<Input>>::ModifiedInput, <T as DynServiceMatcher<Input>>::Service>, <T as DynServiceMatcher<Input>>::Error>> + Send + '_>>
fn match_service_box( &self, input: Input, ) -> Pin<Box<dyn Future<Output = Result<ServiceMatch<<T as DynServiceMatcher<Input>>::ModifiedInput, <T as DynServiceMatcher<Input>>::Service>, <T as DynServiceMatcher<Input>>::Error>> + Send + '_>>
input.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
Source§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
value to writerSource§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
value to writerSource§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
value to writerSource§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
value to writerSource§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
value to writer