pub struct RequestVersionAdapter<S> { /* private fields */ }Expand description
ConnectorService which will adapt the request version if needed.
It will adapt the request version to TargetHttpVersion, or the configured
default version
Implementations§
Source§impl<S> RequestVersionAdapter<S>
impl<S> RequestVersionAdapter<S>
pub fn new(inner: S) -> Self
Sourcepub fn maybe_with_default_version(self, version: Option<Version>) -> Self
pub fn maybe_with_default_version(self, version: Option<Version>) -> Self
Set default request Version which will be used if TargetHttpVersion is
is not present in extensions
Sourcepub fn maybe_set_default_version(
&mut self,
version: Option<Version>,
) -> &mut Self
pub fn maybe_set_default_version( &mut self, version: Option<Version>, ) -> &mut Self
Set default request Version which will be used if TargetHttpVersion is
is not present in extensions
Sourcepub fn with_default_version(self, version: Version) -> Self
pub fn with_default_version(self, version: Version) -> Self
Set default request Version which will be used if TargetHttpVersion is
is not present in extensions
Sourcepub fn set_default_version(&mut self, version: Version) -> &mut Self
pub fn set_default_version(&mut self, version: Version) -> &mut Self
Set default request Version which will be used if TargetHttpVersion is
is not present in extensions
Sourcepub fn without_default_version(self) -> Self
pub fn without_default_version(self) -> Self
Set default request Version which will be used if TargetHttpVersion is
is not present in extensions
Sourcepub fn unset_default_version(&mut self) -> &mut Self
pub fn unset_default_version(&mut self) -> &mut Self
Set default request Version which will be used if TargetHttpVersion is
is not present in extensions
Trait Implementations§
Source§impl<S: Clone> Clone for RequestVersionAdapter<S>
impl<S: Clone> Clone for RequestVersionAdapter<S>
Source§fn clone(&self) -> RequestVersionAdapter<S>
fn clone(&self) -> RequestVersionAdapter<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: Debug> Debug for RequestVersionAdapter<S>
impl<S: Debug> Debug for RequestVersionAdapter<S>
Source§impl<S, Body> Service<Request<Body>> for RequestVersionAdapter<S>
impl<S, Body> Service<Request<Body>> for RequestVersionAdapter<S>
Source§type Output = EstablishedClientConnection<<S as ConnectorService<Request<Body>>>::Connection, Request<Body>>
type Output = EstablishedClientConnection<<S as ConnectorService<Request<Body>>>::Connection, Request<Body>>
The type of the output returned by the service.
Auto Trait Implementations§
impl<S> Freeze for RequestVersionAdapter<S>where
S: Freeze,
impl<S> RefUnwindSafe for RequestVersionAdapter<S>where
S: RefUnwindSafe,
impl<S> Send for RequestVersionAdapter<S>where
S: Send,
impl<S> Sync for RequestVersionAdapter<S>where
S: Sync,
impl<S> Unpin for RequestVersionAdapter<S>where
S: Unpin,
impl<S> UnsafeUnpin for RequestVersionAdapter<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for RequestVersionAdapter<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Mutably borrows from an owned value. Read more
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<S, Input, Connection> ConnectorService<Input> for S
impl<S, Input, Connection> ConnectorService<Input> for S
Source§type Connection = Connection
type Connection = Connection
Connection returned by the
ConnectorServiceSource§type Error = <S as Service<Input>>::Error
type Error = <S as Service<Input>>::Error
Error returned in case of connection / setup failure
Source§fn connect(
&self,
input: Input,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, <S as ConnectorService<Input>>::Error>> + Send
fn connect( &self, input: Input, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, <S as ConnectorService<Input>>::Error>> + Send
Establish a connection, which often involves some kind of handshake,
or connection revival.
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Converts
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>
Converts
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<S> IntoEndpointService<(S,)> for S
impl<S> IntoEndpointService<(S,)> for S
type Service = S
Source§fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
convert the type into a
rama_core::Service.Source§impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
type Service = S
Source§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
convert the type into a
rama_core::Service with state.