pub struct HeaderFromStrConfigService<T, S, C = Vec<T>> { /* private fields */ }Expand description
A Service which extracts a header CSV config from a request or response
and inserts it into the Extensions of that object.
Implementations§
Source§impl<T, S, C> HeaderFromStrConfigService<T, S, C>
impl<T, S, C> HeaderFromStrConfigService<T, S, C>
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes self, returning the underlying service.
Sourcepub const fn required(inner: S, header_name: HeaderName) -> Self
pub const fn required(inner: S, header_name: HeaderName) -> Self
Create a new HeaderFromStrConfigService with the given inner service
and header name, on which to extract the config,
and which will fail if the header is missing.
Sourcepub const fn optional(inner: S, header_name: HeaderName) -> Self
pub const fn optional(inner: S, header_name: HeaderName) -> Self
Create a new HeaderFromStrConfigService with the given inner service
and header name, on which to extract the config,
and which will gracefully accept if the header is missing.
Sourcepub fn set_repeat(&mut self, repeat: bool) -> &mut Self
pub fn set_repeat(&mut self, repeat: bool) -> &mut Self
Toggle repeat on/off. When repeat is enabled the
data config will be parsed and inserted as a container of type C (defaults to Vec<T>).
Sourcepub fn with_repeat(self, repeat: bool) -> Self
pub fn with_repeat(self, repeat: bool) -> Self
Toggle repeat on/off. When repeat is enabled the
data config will be parsed and inserted as a container of type C (defaults to Vec<T>).
Trait Implementations§
Source§impl<T, S, C> Clone for HeaderFromStrConfigService<T, S, C>where
S: Clone,
impl<T, S, C> Clone for HeaderFromStrConfigService<T, S, C>where
S: Clone,
Source§impl<T, S, C> Debug for HeaderFromStrConfigService<T, S, C>where
S: Debug,
impl<T, S, C> Debug for HeaderFromStrConfigService<T, S, C>where
S: Debug,
Source§impl<T, S, State, Body, E, C> Service<State, Request<Body>> for HeaderFromStrConfigService<T, S, C>where
S: Service<State, Request<Body>, Error = E>,
T: FromStr<Err: Into<BoxError> + Send + Sync + 'static> + Send + Sync + 'static + Clone,
C: FromIterator<T> + Send + Sync + 'static + Clone,
State: Clone + Send + Sync + 'static,
Body: Send + Sync + 'static,
E: Into<BoxError> + Send + Sync + 'static,
impl<T, S, State, Body, E, C> Service<State, Request<Body>> for HeaderFromStrConfigService<T, S, C>where
S: Service<State, Request<Body>, Error = E>,
T: FromStr<Err: Into<BoxError> + Send + Sync + 'static> + Send + Sync + 'static + Clone,
C: FromIterator<T> + Send + Sync + 'static + Clone,
State: Clone + Send + Sync + 'static,
Body: Send + Sync + 'static,
E: Into<BoxError> + Send + Sync + 'static,
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Auto Trait Implementations§
impl<T, S, C = Vec<T>> !Freeze for HeaderFromStrConfigService<T, S, C>
impl<T, S, C> RefUnwindSafe for HeaderFromStrConfigService<T, S, C>where
S: RefUnwindSafe,
impl<T, S, C> Send for HeaderFromStrConfigService<T, S, C>where
S: Send,
impl<T, S, C> Sync for HeaderFromStrConfigService<T, S, C>where
S: Sync,
impl<T, S, C> Unpin for HeaderFromStrConfigService<T, S, C>where
S: Unpin,
impl<T, S, C> UnwindSafe for HeaderFromStrConfigService<T, S, C>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
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
ConnectorServiceSource§type Error = <S as Service<State, Request>>::Error
type Error = <S as Service<State, Request>>::Error
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
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>
execute method.Source§type ExecuteError = <S as Service<State, Request<Body>>>::Error
type ExecuteError = <S as Service<State, Request<Body>>>::Error
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>
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>
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>
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>
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>
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>
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>>
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>
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