pub struct RemoveRequestHeader<S> { /* private fields */ }
Expand description
Middleware that removes headers from a request.
Implementations§
Source§impl<S> RemoveRequestHeader<S>
impl<S> RemoveRequestHeader<S>
Sourcepub fn prefix(prefix: impl Into<Cow<'static, str>>, inner: S) -> Self
pub fn prefix(prefix: impl Into<Cow<'static, str>>, inner: S) -> Self
Create a new RemoveRequestHeader
.
Removes headers by prefix.
Sourcepub fn exact(header: HeaderName, inner: S) -> Self
pub fn exact(header: HeaderName, inner: S) -> Self
Create a new RemoveRequestHeader
.
Removes the header with the exact name.
Sourcepub fn hop_by_hop(inner: S) -> Self
pub fn hop_by_hop(inner: S) -> Self
Create a new RemoveRequestHeader
.
Removes all hop-by-hop headers as specified in RFC 2616. This does not support other hop-by-hop headers defined in section-14.10.
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes self
, returning the underlying service.
Trait Implementations§
Source§impl<S: Clone> Clone for RemoveRequestHeader<S>
impl<S: Clone> Clone for RemoveRequestHeader<S>
Source§impl<S: Debug> Debug for RemoveRequestHeader<S>
impl<S: Debug> Debug for RemoveRequestHeader<S>
Source§impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for RemoveRequestHeader<S>
impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for RemoveRequestHeader<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
The type of response returned by the service.
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
The type of error returned by the service.
Auto Trait Implementations§
impl<S> !Freeze for RemoveRequestHeader<S>
impl<S> RefUnwindSafe for RemoveRequestHeader<S>where
S: RefUnwindSafe,
impl<S> Send for RemoveRequestHeader<S>where
S: Send,
impl<S> Sync for RemoveRequestHeader<S>where
S: Sync,
impl<S> Unpin for RemoveRequestHeader<S>where
S: Unpin,
impl<S> UnwindSafe for RemoveRequestHeader<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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, State, Request, Connection> ConnectorService<State, Request> for S
impl<S, State, Request, Connection> ConnectorService<State, Request> for S
Source§type Connection = Connection
type Connection = Connection
Connection returned by the
ConnectorService
Source§type Error = <S as Service<State, Request>>::Error
type Error = <S as Service<State, Request>>::Error
Error returned in case of connection / setup failure
Source§fn connect(
&self,
ctx: Context<State>,
req: Request,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<State, Request>>::Connection, State, Request>, <S as ConnectorService<State, Request>>::Error>> + Send
fn connect( &self, ctx: Context<State>, req: Request, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<State, Request>>::Connection, State, Request>, <S as ConnectorService<State, Request>>::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<State, S, Body> HttpClientExt<State> for S
impl<State, S, Body> HttpClientExt<State> for S
Source§type ExecuteResponse = Response<Body>
type ExecuteResponse = Response<Body>
The response type returned by the
execute
method.Source§type ExecuteError = <S as Service<State, Request<Body>>>::Error
type ExecuteError = <S as Service<State, Request<Body>>>::Error
The error type returned by the
execute
method.Source§fn get(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn get( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
Convenience method to make a
GET
request to a URL. Read moreSource§fn post(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn post( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
Convenience method to make a
POST
request to a URL. Read moreSource§fn put(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn put( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
Convenience method to make a
PUT
request to a URL. Read moreSource§fn patch(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn patch( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
Convenience method to make a
PATCH
request to a URL. Read moreSource§fn delete(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn delete( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
Convenience method to make a
DELETE
request to a URL. Read moreSource§fn head(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn head( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
Convenience method to make a
HEAD
request to a URL. Read moreSource§fn request(
&self,
method: Method,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn request( &self, method: Method, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
Source§fn execute(
&self,
ctx: Context<State>,
request: Request<Body>,
) -> impl Future<Output = Result<<S as HttpClientExt<State>>::ExecuteResponse, <S as HttpClientExt<State>>::ExecuteError>>
fn execute( &self, ctx: Context<State>, request: Request<Body>, ) -> impl Future<Output = Result<<S as HttpClientExt<State>>::ExecuteResponse, <S as HttpClientExt<State>>::ExecuteError>>
Executes a
Request
. Read moreSource§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<State, S, R> IntoEndpointService<State, (State, R)> for Swhere
State: Clone + Send + Sync + 'static,
S: Service<State, Request<Body>, Response = R, Error = Infallible>,
R: IntoResponse + Send + Sync + 'static,
impl<State, S, R> IntoEndpointService<State, (State, R)> for Swhere
State: Clone + Send + Sync + 'static,
S: Service<State, Request<Body>, Response = R, Error = Infallible>,
R: IntoResponse + Send + Sync + 'static,
Source§fn into_endpoint_service(
self,
) -> impl Service<State, Request<Body>, Response = Response<Body>, Error = Infallible>
fn into_endpoint_service( self, ) -> impl Service<State, Request<Body>, Response = Response<Body>, Error = Infallible>
convert the type into a
rama_core::Service
.