aws_smithy_runtime::client::http::test_util

Function infallible_client_fn

source
pub fn infallible_client_fn<B>(
    f: impl Fn(Request<SdkBody>) -> Response<B> + Send + Sync + 'static,
) -> SharedHttpClient
where B: Into<SdkBody>,
Available on crate features client and test-util only.
Expand description

Create a SharedHttpClient from Fn(http:Request) -> http::Response

ยงExamples

use aws_smithy_runtime::client::http::test_util::infallible_client_fn;
let http_client = infallible_client_fn(|_req| http_02x::Response::builder().status(200).body("OK!").unwrap());