[−][src]Struct swagger::composites::CompositeMakeService
Wraps a vector of pairs, each consisting of a base path as a &'static str
and a MakeService
instance. Implements Deref<Vec>
and DerefMut<Vec>
so
these can be manipulated using standard Vec
methods.
The Service
returned by calling make_service()
will pass an incoming
request to the first Service
in the list for which the associated
base path is a prefix of the request path.
Example Usage
let my_make_service1 = MakeService1::new(); let my_make_service2 = MakeService2::new(); let mut composite_make_service = CompositeMakeService::new(); composite_make_service.push(("/base/path/1", my_make_service1)); composite_make_service.push(("/base/path/2", my_make_service2)); // use as you would any `MakeService` instance
Methods
impl<C, U, V: NotFound<V>, W> CompositeMakeService<C, U, V, W>
[src]
Trait Implementations
impl<C, U, V, W> Debug for CompositeMakeService<C, U, V, W> where
V: NotFound<V> + 'static,
W: 'static,
[src]
V: NotFound<V> + 'static,
W: 'static,
impl<C: Default, U: Default, V: Default, W: Default> Default for CompositeMakeService<C, U, V, W> where
V: NotFound<V> + 'static,
W: 'static,
[src]
V: NotFound<V> + 'static,
W: 'static,
fn default() -> CompositeMakeService<C, U, V, W>
[src]
impl<C, U, V, W> Deref for CompositeMakeService<C, U, V, W> where
V: NotFound<V> + 'static,
W: 'static,
[src]
V: NotFound<V> + 'static,
W: 'static,
type Target = Vec<(&'static str, Box<dyn BoxedMakeService<C, U, V, W>>)>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<C, U, V, W> DerefMut for CompositeMakeService<C, U, V, W> where
V: NotFound<V> + 'static,
W: 'static,
[src]
V: NotFound<V> + 'static,
W: 'static,
impl<'a, C, U, V, W> MakeService<&'a C> for CompositeMakeService<&'a C, U, V, W> where
U: Payload,
V: NotFound<V> + 'static + Payload,
W: Error + Send + Sync + 'static,
[src]
U: Payload,
V: NotFound<V> + 'static + Payload,
W: Error + Send + Sync + 'static,
type ReqBody = U
The Payload
body of the http::Request
.
type ResBody = V
The Payload
body of the http::Response
.
type Error = W
The error type that can be returned by Service
s.
type Service = CompositeService<U, V, W>
The resolved Service
from new_service()
.
type MakeError = Error
The error type that can be returned when creating a new Service
.
type Future = FutureResult<Self::Service, Error>
The future returned from new_service
of a Service
.
fn make_service(
&mut self,
_service_ctx: &'a C
) -> FutureResult<Self::Service, Error>
[src]
&mut self,
_service_ctx: &'a C
) -> FutureResult<Self::Service, Error>
fn poll_ready(&mut self) -> Result<Async<()>, Self::MakeError>
[src]
Auto Trait Implementations
impl<C, U, V, W> !RefUnwindSafe for CompositeMakeService<C, U, V, W>
impl<C, U, V, W> !Send for CompositeMakeService<C, U, V, W>
impl<C, U, V, W> !Sync for CompositeMakeService<C, U, V, W>
impl<C, U, V, W> Unpin for CompositeMakeService<C, U, V, W>
impl<C, U, V, W> !UnwindSafe for CompositeMakeService<C, U, V, W>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, SC, T, Rq, Rs, Er, S> BoxedMakeService<&'a SC, Rq, Rs, Er> for T where
Er: Error + Send + Sync + 'static,
Rq: Payload,
Rs: Payload,
S: Service<ReqBody = Rq, ResBody = Rs, Error = Er, Future = Box<dyn Future<Item = Response<Rs>, Error = Er> + 'static>> + 'static,
T: MakeService<&'a SC, ReqBody = Rq, ResBody = Rs, Error = Er, Future = FutureResult<S, Error>, Service = S, MakeError = Error>,
[src]
Er: Error + Send + Sync + 'static,
Rq: Payload,
Rs: Payload,
S: Service<ReqBody = Rq, ResBody = Rs, Error = Er, Future = Box<dyn Future<Item = Response<Rs>, Error = Er> + 'static>> + 'static,
T: MakeService<&'a SC, ReqBody = Rq, ResBody = Rs, Error = Er, Future = FutureResult<S, Error>, Service = S, MakeError = Error>,
fn boxed_make_service(
&mut Self,
&'a SC
) -> Result<Box<dyn Service<ResBody = Rs, Future = Box<dyn Future<Item = Response<Rs>, Error = Er> + 'static>, ReqBody = Rq, Error = Er> + 'static>, Error>
[src]
&mut Self,
&'a SC
) -> Result<Box<dyn Service<ResBody = Rs, Future = Box<dyn Future<Item = Response<Rs>, Error = Er> + 'static>, ReqBody = Rq, Error = Er> + 'static>, Error>
Call the make_service
method of the wrapped MakeService
and Box
the result
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<N, Ctx> MakeService<Ctx> for N where
N: NewService,
[src]
N: NewService,
type ReqBody = <N as NewService>::ReqBody
The Payload
body of the http::Request
.
type ResBody = <N as NewService>::ResBody
The Payload
body of the http::Response
.
type Error = <N as NewService>::Error
The error type that can be returned by Service
s.
type Service = <N as NewService>::Service
The resolved Service
from new_service()
.
type Future = <N as NewService>::Future
The future returned from new_service
of a Service
.
type MakeError = <N as NewService>::InitError
The error type that can be returned when creating a new Service
.
fn poll_ready(
&mut self
) -> Result<Async<()>, <N as MakeService<Ctx>>::MakeError>
[src]
&mut self
) -> Result<Async<()>, <N as MakeService<Ctx>>::MakeError>
fn make_service(&mut self, Ctx) -> <N as MakeService<Ctx>>::Future
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,