pub trait HttpConnector:
Send
+ Sync
+ Debug {
// Required method
fn call(&self, request: HttpRequest) -> HttpConnectorFuture ⓘ;
}
Available on crate feature
client
only.Expand description
Trait with a call
function that asynchronously converts a request into a response.
Ordinarily, a connector would use an underlying HTTP library such as hyper, and any associated HTTPS implementation alongside it to service requests.
However, it can also be useful to create fake/mock connectors implementing this trait for testing.
Required Methods§
Sourcefn call(&self, request: HttpRequest) -> HttpConnectorFuture ⓘ
fn call(&self, request: HttpRequest) -> HttpConnectorFuture ⓘ
Asynchronously converts a request into a response.