pub struct ReqwestHttpClient { /* private fields */ }Expand description
A Smithy HttpClient implementation backed by reqwest::Client.
This type lets Smithy-based SDK clients send requests through a preconfigured
reqwest client, allowing you to share connection pools and transport-level
settings across your application.
Use ReqwestHttpClient::new when you already have a customized
reqwest::Client. If you just need a default configuration, use
ReqwestHttpClient::default.
Implementations§
Source§impl ReqwestHttpClient
impl ReqwestHttpClient
Sourcepub fn new(client: Client) -> Self
pub fn new(client: Client) -> Self
Creates a Smithy HTTP client from an existing reqwest::Client.
The provided reqwest client is cloned as needed when Smithy creates
connectors, so it can be shared safely across multiple service clients.
§Examples
use aws_smithy_http_client_reqwest::ReqwestHttpClient;
let reqwest_client = reqwest::Client::new();
let http_client = ReqwestHttpClient::new(reqwest_client);Trait Implementations§
Source§impl Debug for ReqwestHttpClient
impl Debug for ReqwestHttpClient
Source§impl Default for ReqwestHttpClient
impl Default for ReqwestHttpClient
Source§impl HttpClient for ReqwestHttpClient
impl HttpClient for ReqwestHttpClient
Source§fn http_connector(
&self,
settings: &HttpConnectorSettings,
_components: &RuntimeComponents,
) -> SharedHttpConnector
fn http_connector( &self, settings: &HttpConnectorSettings, _components: &RuntimeComponents, ) -> SharedHttpConnector
Returns a HTTP connector based on the requested connector settings. Read more
Source§fn validate_base_client_config(
&self,
runtime_components: &RuntimeComponentsBuilder,
cfg: &ConfigBag,
) -> Result<(), Box<dyn Error + Sync + Send>>
fn validate_base_client_config( &self, runtime_components: &RuntimeComponentsBuilder, cfg: &ConfigBag, ) -> Result<(), Box<dyn Error + Sync + Send>>
Validate the base client configuration. Read more
Source§fn validate_final_config(
&self,
runtime_components: &RuntimeComponents,
cfg: &ConfigBag,
) -> Result<(), Box<dyn Error + Sync + Send>>
fn validate_final_config( &self, runtime_components: &RuntimeComponents, cfg: &ConfigBag, ) -> Result<(), Box<dyn Error + Sync + Send>>
Validate the final client configuration. Read more
Source§fn connector_metadata(&self) -> Option<ConnectorMetadata>
fn connector_metadata(&self) -> Option<ConnectorMetadata>
Provide metadata about the crate that this HttpClient uses to make connectors. Read more
Auto Trait Implementations§
impl Freeze for ReqwestHttpClient
impl !RefUnwindSafe for ReqwestHttpClient
impl Send for ReqwestHttpClient
impl Sync for ReqwestHttpClient
impl Unpin for ReqwestHttpClient
impl UnsafeUnpin for ReqwestHttpClient
impl !UnwindSafe for ReqwestHttpClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.