pub struct MultiProtocolRoutingService { /* private fields */ }Expand description
A service routing normalized requests to a shared handler collection through the protocols the service declares.
Hyper incoming bodies flow to handlers without boxing. Other compatible request bodies are accepted and erased into a boxed state on entry; normalized request bodies retain their existing representation.
Clones share all routing state through one Arc. Routing clones only the
selected handler, so cloning the service for each request stays cheap.
Implementations§
Source§impl MultiProtocolRoutingService
impl MultiProtocolRoutingService
Sourcepub fn builder(
service: &'static ServiceSchema<'static>,
) -> MultiProtocolRoutingServiceBuilder
pub fn builder( service: &'static ServiceSchema<'static>, ) -> MultiProtocolRoutingServiceBuilder
Starts configuring routing for the supplied service schema.
Trait Implementations§
Source§impl Clone for MultiProtocolRoutingService
impl Clone for MultiProtocolRoutingService
Source§impl Debug for MultiProtocolRoutingService
impl Debug for MultiProtocolRoutingService
Source§impl<RB> Service<Request<RB>> for MultiProtocolRoutingService
Any compatible body enters. A hyper incoming body and an already-normalized
RequestBody stay unerased; any other body — tests, adapters,
upgrade layers — is erased into a boxed state (see RequestBody::new).
impl<RB> Service<Request<RB>> for MultiProtocolRoutingService
Any compatible body enters. A hyper incoming body and an already-normalized
RequestBody stay unerased; any other body — tests, adapters,
upgrade layers — is erased into a boxed state (see RequestBody::new).
Source§type Error = Infallible
type Error = Infallible
Errors produced by the service.
Source§type Future = MultiProtocolRoutingFuture
type Future = MultiProtocolRoutingFuture
The future response value.
Source§fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Infallible>>
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Infallible>>
Returns
Poll::Ready(Ok(())) when the service is able to process requests. Read moreAuto Trait Implementations§
impl Freeze for MultiProtocolRoutingService
impl !RefUnwindSafe for MultiProtocolRoutingService
impl Send for MultiProtocolRoutingService
impl Sync for MultiProtocolRoutingService
impl Unpin for MultiProtocolRoutingService
impl UnsafeUnpin for MultiProtocolRoutingService
impl !UnwindSafe for MultiProtocolRoutingService
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,
§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>
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 moreCreates a shared type from an unshared type.
Source§impl<F, Op, Exts> OperationServiceExt<Op, Exts> for Fwhere
Op: OperationShape,
F: OperationService<Op, Exts>,
impl<F, Op, Exts> OperationServiceExt<Op, Exts> for Fwhere
Op: OperationShape,
F: OperationService<Op, Exts>,
§impl<T, Request> ServiceExt<Request> for Twhere
T: Service<Request> + ?Sized,
impl<T, Request> ServiceExt<Request> for Twhere
T: Service<Request> + ?Sized,
§fn ready(&mut self) -> Ready<'_, Self, Request>where
Self: Sized,
fn ready(&mut self) -> Ready<'_, Self, Request>where
Self: Sized,
Yields a mutable reference to the service when it is ready to accept a request.
§fn ready_oneshot(self) -> ReadyOneshot<Self, Request>where
Self: Sized,
fn ready_oneshot(self) -> ReadyOneshot<Self, Request>where
Self: Sized,
Yields the service when it is ready to accept a request.
§fn oneshot(self, req: Request) -> Oneshot<Self, Request>where
Self: Sized,
fn oneshot(self, req: Request) -> Oneshot<Self, Request>where
Self: Sized,
Consume this
Service, calling it with the provided request once it is ready.§fn and_then<F>(self, f: F) -> AndThen<Self, F>
fn and_then<F>(self, f: F) -> AndThen<Self, F>
Executes a new future after this service’s future resolves. This does
not alter the behaviour of the
poll_ready method. Read more§fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
Maps this service’s response value to a different value. This does not
alter the behaviour of the
poll_ready method. Read more§fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
Maps this service’s error value to a different value. This does not
alter the behaviour of the
poll_ready method. Read more§fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
Maps this service’s result type (
Result<Self::Response, Self::Error>)
to a different value, regardless of whether the future succeeds or
fails. Read more§fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F>
fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F>
Composes a function in front of the service. Read more
§fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F>
fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F>
Composes an asynchronous function after this service. Read more
§fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F>
fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F>
Composes a function that transforms futures produced by the service. Read more