pub struct HttpClientBuilder { /* private fields */ }Expand description
Builder for HttpClient.
Implementations§
Source§impl HttpClientBuilder
impl HttpClientBuilder
Sourcepub fn new(base_url: impl Into<String>, auth: Arc<dyn AuthInjector>) -> Self
pub fn new(base_url: impl Into<String>, auth: Arc<dyn AuthInjector>) -> Self
Creates a builder with a base URL and auth injector.
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Sets the user-agent for this client.
Sourcepub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
pub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
Alias for HttpClientBuilder::user_agent for migration readability.
Sourcepub fn default_headers(self, headers: BTreeMap<String, String>) -> Self
pub fn default_headers(self, headers: BTreeMap<String, String>) -> Self
Sets headers sent on every request.
Sourcepub fn with_default_headers(self, headers: BTreeMap<String, String>) -> Self
pub fn with_default_headers(self, headers: BTreeMap<String, String>) -> Self
Alias for HttpClientBuilder::default_headers for migration readability.
Sourcepub fn logger(self, logger: Arc<dyn TransportLogger>) -> Self
pub fn logger(self, logger: Arc<dyn TransportLogger>) -> Self
Sets the transport debug logger.
Sourcepub fn with_logger(self, logger: Arc<dyn TransportLogger>) -> Self
pub fn with_logger(self, logger: Arc<dyn TransportLogger>) -> Self
Alias for HttpClientBuilder::logger for migration readability.
Sourcepub fn build(self) -> HttpClient
pub fn build(self) -> HttpClient
Builds the client.
Trait Implementations§
Source§impl Clone for HttpClientBuilder
impl Clone for HttpClientBuilder
Source§fn clone(&self) -> HttpClientBuilder
fn clone(&self) -> HttpClientBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HttpClientBuilder
impl !RefUnwindSafe for HttpClientBuilder
impl Send for HttpClientBuilder
impl Sync for HttpClientBuilder
impl Unpin for HttpClientBuilder
impl UnsafeUnpin for HttpClientBuilder
impl !UnwindSafe for HttpClientBuilder
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