pub struct HttpClientFactory;Expand description
Public factory used to build reqwest-backed HttpClient instances.
Implementations§
Source§impl HttpClientFactory
impl HttpClientFactory
Sourcepub fn create(&self) -> HttpResult<HttpClient>
pub fn create(&self) -> HttpResult<HttpClient>
Creates a new HttpClient with default HttpClientOptions.
§Returns
HttpClient or HttpError (proxy/build failures).
Sourcepub fn create_with_options(
&self,
options: HttpClientOptions,
) -> HttpResult<HttpClient>
pub fn create_with_options( &self, options: HttpClientOptions, ) -> HttpResult<HttpClient>
Applies options to a new reqwest::Client::builder, then wraps the built client.
§Parameters
options: Full client configuration.
§Returns
HttpClient or HttpError (proxy/build failures).
Sourcepub fn create_from_config<R>(
&self,
config: &R,
) -> Result<HttpClient, HttpConfigError>where
R: ConfigReader + ?Sized,
pub fn create_from_config<R>(
&self,
config: &R,
) -> Result<HttpClient, HttpConfigError>where
R: ConfigReader + ?Sized,
Loads HttpClientOptions from config, validates them, then calls
HttpClientFactory::create_with_options.
§Parameters
config: AnyConfigReader(rootqubit_config::Configor aqubit_config::ConfigPrefixViewfromConfigReader::prefix_view).
§Returns
Ok(HttpClient)when parsing, validation, and client build succeed.Err(HttpConfigError)on config or validation errors; build failures are mapped toHttpConfigError.
Trait Implementations§
Source§impl Clone for HttpClientFactory
impl Clone for HttpClientFactory
Source§fn clone(&self) -> HttpClientFactory
fn clone(&self) -> HttpClientFactory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpClientFactory
impl Debug for HttpClientFactory
Source§impl Default for HttpClientFactory
impl Default for HttpClientFactory
Source§fn default() -> HttpClientFactory
fn default() -> HttpClientFactory
Returns the “default value” for a type. Read more
impl Copy for HttpClientFactory
Auto Trait Implementations§
impl Freeze for HttpClientFactory
impl RefUnwindSafe for HttpClientFactory
impl Send for HttpClientFactory
impl Sync for HttpClientFactory
impl Unpin for HttpClientFactory
impl UnsafeUnpin for HttpClientFactory
impl UnwindSafe for HttpClientFactory
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