pub struct HttpPolicyClientBuilder { /* private fields */ }Expand description
Builder of an HttpPolicyClient.
Implementations§
Source§impl HttpPolicyClientBuilder
impl HttpPolicyClientBuilder
Sourcepub fn headers(self, headers: Headers) -> Self
pub fn headers(self, headers: Headers) -> Self
Sets the headers sent with every request (for example an
authorization header). Never logged unmasked.
Sourcepub fn header(self, name: &str, value: &str) -> Self
pub fn header(self, name: &str, value: &str) -> Self
Adds one header; invalid names or values are skipped.
Sourcepub fn transport(self, transport: SharedTransport) -> Self
pub fn transport(self, transport: SharedTransport) -> Self
Uses transport instead of the shared default transport.
Sourcepub fn url_policy(self, policy: UrlPolicy) -> Self
pub fn url_policy(self, policy: UrlPolicy) -> Self
Sets the URL policy applied to the server URL (default: HTTPS and public networks only).
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Sets the per-request timeout (default: the transport’s own timeout).
Sourcepub fn max_response_bytes(self, max_response_bytes: u64) -> Self
pub fn max_response_bytes(self, max_response_bytes: u64) -> Self
Sets the response body limit (default 1 MiB).
Sourcepub fn build(self) -> Result<HttpPolicyClient, PolicyError>
pub fn build(self) -> Result<HttpPolicyClient, PolicyError>
Builds the client.
§Errors
Returns PolicyError::Transport when no transport was given and
the default transport cannot be created.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HttpPolicyClientBuilder
impl !UnwindSafe for HttpPolicyClientBuilder
impl Freeze for HttpPolicyClientBuilder
impl Send for HttpPolicyClientBuilder
impl Sync for HttpPolicyClientBuilder
impl Unpin for HttpPolicyClientBuilder
impl UnsafeUnpin for HttpPolicyClientBuilder
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