Struct ThenSvc

Source
pub struct ThenSvc<S1, S2, Int, Res> { /* private fields */ }
Expand description

Service1(Response) -> Intermediate => Service2(Intermediate) -> Response

Implementations§

Source§

impl<S1, S2, Int, Res> ThenSvc<S1, S2, Int, Res>

Source

pub fn new(svc1: S1, svc2: S2) -> Self

Trait Implementations§

Source§

impl<S1, S2, Req, Int, Res> Svc<Req> for ThenSvc<S1, S2, Int, Res>
where S1: Svc<Req, Res = Int>, S2: Svc<Int, Res = Res>,

Source§

type Res = Res

Output type.
Source§

type Fut = ThenSvcFut<S1, S2, Req, Int, Res>

Response future.
Source§

fn exec(self: Pin<&mut Self>, req: Req) -> Self::Fut

Processes request, producing a future that outputs the response type.
Source§

fn poll_ready(self: Pin<&mut Self>, cx: Context<'_>) -> Poll<()>

To be called before exec to signal wether the service is ready to process requests. As such, the check should be inexpensive. Returning Poll::Pending acts as back-pressure. The default implementation unconditionally indicates the service is ready.
Source§

impl<'pin, S1, S2, Int, Res> Unpin for ThenSvc<S1, S2, Int, Res>
where PinnedFieldsOf<__ThenSvc<'pin, S1, S2, Int, Res>>: Unpin,

Auto Trait Implementations§

§

impl<S1, S2, Int, Res> Freeze for ThenSvc<S1, S2, Int, Res>
where S1: Freeze, S2: Freeze,

§

impl<S1, S2, Int, Res> RefUnwindSafe for ThenSvc<S1, S2, Int, Res>

§

impl<S1, S2, Int, Res> Send for ThenSvc<S1, S2, Int, Res>
where S1: Send, S2: Send, Int: Send, Res: Send,

§

impl<S1, S2, Int, Res> Sync for ThenSvc<S1, S2, Int, Res>
where S1: Sync, S2: Sync, Int: Sync, Res: Sync,

§

impl<S1, S2, Int, Res> UnwindSafe for ThenSvc<S1, S2, Int, Res>
where S1: UnwindSafe, S2: UnwindSafe, Int: UnwindSafe, Res: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.