pub struct SquareHttpClientConfigBuilder { /* private fields */ }
Expand description
Builder for HTTP client settings Default values are used for any settings that are not explicitly set
§Example - Create a new HTTP client with specific settings
use square_rust::http::client::config::SquareHttpClientConfig;
use square_rust::http::headers::Headers;
let http_client_configuration =
SquareHttpClientConfig::builder()
.timeout(15)
.user_agent(String::from("some_user_agent"))
.default_headers(Headers::default())
.build();
§Example - Create a new HTTP client with default settings
use square_rust::http::client::config::SquareHttpClientConfig;
let http_client_configuration = SquareHttpClientConfig::builder().build();
Implementations§
Source§impl SquareHttpClientConfigBuilder
Builder for HTTP client settings
impl SquareHttpClientConfigBuilder
Builder for HTTP client settings
Sourcepub fn user_agent(&mut self, user_agent: String) -> &mut Self
pub fn user_agent(&mut self, user_agent: String) -> &mut Self
Sets the specific User Agent to use for requests
Sourcepub fn default_headers(&mut self, default_headers: Headers) -> &mut Self
pub fn default_headers(&mut self, default_headers: Headers) -> &mut Self
Sets the default headers to send with each request
Sourcepub fn retry_configuration(
&mut self,
retry_configuration: RetryConfig,
) -> &mut Self
pub fn retry_configuration( &mut self, retry_configuration: RetryConfig, ) -> &mut Self
Sets the retry configuration
Sourcepub fn build(&self) -> SquareHttpClientConfig
pub fn build(&self) -> SquareHttpClientConfig
Builds the HTTP client configuration
Trait Implementations§
Source§impl Default for SquareHttpClientConfigBuilder
impl Default for SquareHttpClientConfigBuilder
Source§fn default() -> SquareHttpClientConfigBuilder
fn default() -> SquareHttpClientConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SquareHttpClientConfigBuilder
impl RefUnwindSafe for SquareHttpClientConfigBuilder
impl Send for SquareHttpClientConfigBuilder
impl Sync for SquareHttpClientConfigBuilder
impl Unpin for SquareHttpClientConfigBuilder
impl UnwindSafe for SquareHttpClientConfigBuilder
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