Skip to main content

HttpService

Trait HttpService 

Source
pub trait HttpService:
    Debug
    + Send
    + Sync
    + 'static {
    // Required method
    fn call<'life0, 'async_trait>(
        &'life0 self,
        req: HttpRequest,
    ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Available on crate feature cloud-base only.
Expand description

An asynchronous function from a HttpRequest to a HttpResponse.

Required Methods§

Source

fn call<'life0, 'async_trait>( &'life0 self, req: HttpRequest, ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Perform HttpRequest returning HttpResponse

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl HttpService for Client

Source§

fn call<'life0, 'async_trait>( &'life0 self, req: HttpRequest, ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§