Trait tower::ServiceExt[][src]

pub trait ServiceExt<Request>: Service<Request> {
    pub fn ready(&mut self) -> Ready<'_, Self, Request>

Notable traits for Ready<'a, T, Request>

impl<'a, T, Request> Future for Ready<'a, T, Request> where
    T: Service<Request>, 
type Output = Result<(), <T as Service<Request>>::Error>;
{ ... }
pub fn ready_and(&mut self) -> ReadyAnd<'_, Self, Request> { ... }
pub fn ready_oneshot(self) -> ReadyOneshot<Self, Request> { ... }
pub fn oneshot(self, req: Request) -> Oneshot<Self, Request>

Notable traits for Oneshot<S, Req>

impl<S, Req> Future for Oneshot<S, Req> where
    S: Service<Req>, 
type Output = Result<<S as Service<Req>>::Response, <S as Service<Req>>::Error>;
{ ... }
pub fn call_all<S>(self, reqs: S) -> CallAll<Self, S>
    where
        S: Stream<Item = Request>,
        Self::Error: Into<Box<dyn Error + 'static + Send + Sync, Global>>
, { ... } }

An extension trait for Services that provides a variety of convenient adapters

Provided methods

pub fn ready(&mut self) -> Ready<'_, Self, Request>

Notable traits for Ready<'a, T, Request>

impl<'a, T, Request> Future for Ready<'a, T, Request> where
    T: Service<Request>, 
type Output = Result<(), <T as Service<Request>>::Error>;
[src]

👎 Deprecated since 0.3.1:

prefer ready_and which yields the service

Resolves when the service is ready to accept a request.

pub fn ready_and(&mut self) -> ReadyAnd<'_, Self, Request>[src]

Yields a mutable reference to the service when it is ready to accept a request.

pub fn ready_oneshot(self) -> ReadyOneshot<Self, Request>[src]

Yields the service when it is ready to accept a request.

pub fn oneshot(self, req: Request) -> Oneshot<Self, Request>

Notable traits for Oneshot<S, Req>

impl<S, Req> Future for Oneshot<S, Req> where
    S: Service<Req>, 
type Output = Result<<S as Service<Req>>::Response, <S as Service<Req>>::Error>;
[src]

Consume this Service, calling with the providing request once it is ready.

pub fn call_all<S>(self, reqs: S) -> CallAll<Self, S> where
    S: Stream<Item = Request>,
    Self::Error: Into<Box<dyn Error + 'static + Send + Sync, Global>>, 
[src]

Process all requests from the given Stream, and produce a Stream of their responses.

This is essentially Stream<Item = Request> + Self => Stream<Item = Response>. See the documentation for CallAll for details.

Loading content...

Implementors

impl<T, Request> ServiceExt<Request> for T where
    T: Service<Request> + ?Sized
[src]

Loading content...