Trait Client

Source
pub trait Client {
    type RespondError: Error + Send + Sync + 'static;

    // Required method
    fn respond<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Body>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Body>, Self::RespondError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn respond_endpoint<'life0, 'life1, 'async_trait, EP>(
        &'life0 self,
        endpoint: &'life1 EP,
    ) -> Pin<Box<dyn Future<Output = Result<EP::ParseResponseOutput, ClientRespondEndpointError<Self::RespondError, EP::RenderRequestError, EP::ParseResponseError>>> + Send + 'async_trait>>
       where EP: Endpoint + Send + Sync + 'async_trait,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn respond_endpoint_with_callback<'life0, 'life1, 'async_trait, EP, PreRCB, PostRCB>(
        &'life0 self,
        endpoint: &'life1 EP,
        pre_request_callback: PreRCB,
        post_request_callback: PostRCB,
    ) -> Pin<Box<dyn Future<Output = Result<EP::ParseResponseOutput, ClientRespondEndpointError<Self::RespondError, EP::RenderRequestError, EP::ParseResponseError>>> + Send + 'async_trait>>
       where EP: Endpoint + Send + Sync + 'async_trait,
             PreRCB: FnMut(Request<Body>) -> Request<Body> + Send + 'async_trait,
             PostRCB: FnMut(&Response<Body>) + Send + 'async_trait,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn respond_dyn_endpoint<'life0, 'life1, 'async_trait, RRE, PRO, PRE>(
        &'life0 self,
        endpoint: &'life1 (dyn Endpoint<RenderRequestError = RRE, ParseResponseOutput = PRO, ParseResponseError = PRE> + Send + Sync),
    ) -> Pin<Box<dyn Future<Output = Result<PRO, ClientRespondEndpointError<Self::RespondError, RRE, PRE>>> + Send + 'async_trait>>
       where RRE: Error + Send + Sync + 'static + 'async_trait,
             PRE: Error + Send + Sync + 'static + 'async_trait,
             PRO: 'async_trait,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn respond_dyn_endpoint_with_callback<'life0, 'life1, 'async_trait, RRE, PRO, PRE, PreRCB, PostRCB>(
        &'life0 self,
        endpoint: &'life1 (dyn Endpoint<RenderRequestError = RRE, ParseResponseOutput = PRO, ParseResponseError = PRE> + Send + Sync),
        pre_request_callback: PreRCB,
        post_request_callback: PostRCB,
    ) -> Pin<Box<dyn Future<Output = Result<PRO, ClientRespondEndpointError<Self::RespondError, RRE, PRE>>> + Send + 'async_trait>>
       where RRE: Error + Send + Sync + 'static + 'async_trait,
             PRE: Error + Send + Sync + 'static + 'async_trait,
             PreRCB: FnMut(Request<Body>) -> Request<Body> + Send + 'async_trait,
             PostRCB: FnMut(&Response<Body>) + Send + 'async_trait,
             PRO: 'async_trait,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Associated Types§

Source

type RespondError: Error + Send + Sync + 'static

Required Methods§

Source

fn respond<'life0, 'async_trait>( &'life0 self, request: Request<Body>, ) -> Pin<Box<dyn Future<Output = Result<Response<Body>, Self::RespondError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn respond_endpoint<'life0, 'life1, 'async_trait, EP>( &'life0 self, endpoint: &'life1 EP, ) -> Pin<Box<dyn Future<Output = Result<EP::ParseResponseOutput, ClientRespondEndpointError<Self::RespondError, EP::RenderRequestError, EP::ParseResponseError>>> + Send + 'async_trait>>
where EP: Endpoint + Send + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn respond_endpoint_with_callback<'life0, 'life1, 'async_trait, EP, PreRCB, PostRCB>( &'life0 self, endpoint: &'life1 EP, pre_request_callback: PreRCB, post_request_callback: PostRCB, ) -> Pin<Box<dyn Future<Output = Result<EP::ParseResponseOutput, ClientRespondEndpointError<Self::RespondError, EP::RenderRequestError, EP::ParseResponseError>>> + Send + 'async_trait>>
where EP: Endpoint + Send + Sync + 'async_trait, PreRCB: FnMut(Request<Body>) -> Request<Body> + Send + 'async_trait, PostRCB: FnMut(&Response<Body>) + Send + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn respond_dyn_endpoint<'life0, 'life1, 'async_trait, RRE, PRO, PRE>( &'life0 self, endpoint: &'life1 (dyn Endpoint<RenderRequestError = RRE, ParseResponseOutput = PRO, ParseResponseError = PRE> + Send + Sync), ) -> Pin<Box<dyn Future<Output = Result<PRO, ClientRespondEndpointError<Self::RespondError, RRE, PRE>>> + Send + 'async_trait>>
where RRE: Error + Send + Sync + 'static + 'async_trait, PRE: Error + Send + Sync + 'static + 'async_trait, PRO: 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn respond_dyn_endpoint_with_callback<'life0, 'life1, 'async_trait, RRE, PRO, PRE, PreRCB, PostRCB>( &'life0 self, endpoint: &'life1 (dyn Endpoint<RenderRequestError = RRE, ParseResponseOutput = PRO, ParseResponseError = PRE> + Send + Sync), pre_request_callback: PreRCB, post_request_callback: PostRCB, ) -> Pin<Box<dyn Future<Output = Result<PRO, ClientRespondEndpointError<Self::RespondError, RRE, PRE>>> + Send + 'async_trait>>
where RRE: Error + Send + Sync + 'static + 'async_trait, PRE: Error + Send + Sync + 'static + 'async_trait, PreRCB: FnMut(Request<Body>) -> Request<Body> + Send + 'async_trait, PostRCB: FnMut(&Response<Body>) + Send + 'async_trait, PRO: 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§