Function aws_smithy_http_client::test_util::infallible_client_fn
source · pub fn infallible_client_fn<B>(
f: impl Fn(Request<SdkBody>) -> Response<B> + Send + Sync + 'static,
) -> SharedHttpClient
Available on crate feature
test-util
only.Expand description
Create a SharedHttpClient
from Fn(http:Request) -> http::Response
§Examples
use aws_smithy_http_client::test_util::infallible_client_fn;
let http_client = infallible_client_fn(|_req| http::Response::builder().status(200).body("OK!").unwrap());