pub struct HttpTransportClientBuilder<L> { /* private fields */ }
Expand description
Builder for HttpTransportClient
.
Implementations§
Source§impl HttpTransportClientBuilder<Identity>
impl HttpTransportClientBuilder<Identity>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new HttpTransportClientBuilder
.
Source§impl<L> HttpTransportClientBuilder<L>
impl<L> HttpTransportClientBuilder<L>
Sourcepub fn with_custom_cert_store(self, cfg: CustomCertStore) -> Self
pub fn with_custom_cert_store(self, cfg: CustomCertStore) -> Self
See docs crate::HttpClientBuilder::with_custom_cert_store
for more information.
Sourcepub fn max_request_size(self, size: u32) -> Self
pub fn max_request_size(self, size: u32) -> Self
Set the maximum size of a request body in bytes. Default is 10 MiB.
Sourcepub fn max_response_size(self, size: u32) -> Self
pub fn max_response_size(self, size: u32) -> Self
Set the maximum size of a response in bytes. Default is 10 MiB.
Sourcepub fn set_headers(self, headers: HeaderMap) -> Self
pub fn set_headers(self, headers: HeaderMap) -> Self
Set a custom header passed to the server with every request (default is none).
The caller is responsible for checking that the headers do not conflict or are duplicated.
Sourcepub fn set_tcp_no_delay(self, no_delay: bool) -> Self
pub fn set_tcp_no_delay(self, no_delay: bool) -> Self
Configure TCP_NODELAY
on the socket to the supplied value nodelay
.
Default is true
.
Sourcepub fn set_keep_alive(self, duration: Option<Duration>) -> Self
pub fn set_keep_alive(self, duration: Option<Duration>) -> Self
Configure the keep-alive duration for the connection.
Sourcepub fn set_keep_alive_interval(self, interval: Option<Duration>) -> Self
pub fn set_keep_alive_interval(self, interval: Option<Duration>) -> Self
Configure the keep-alive interval for the connection.
Sourcepub fn set_keep_alive_retries(self, retries: Option<u32>) -> Self
pub fn set_keep_alive_retries(self, retries: Option<u32>) -> Self
Configure the number of keep-alive retries for the connection.
Sourcepub fn set_service<T>(
self,
service: ServiceBuilder<T>,
) -> HttpTransportClientBuilder<T>
pub fn set_service<T>( self, service: ServiceBuilder<T>, ) -> HttpTransportClientBuilder<T>
Configure a tower service.
Sourcepub fn build<S, B>(
self,
target: impl AsRef<str>,
) -> Result<HttpTransportClient<S>, Error>where
L: Layer<HttpBackend, Service = S>,
S: Service<HttpRequest, Response = HttpResponse<B>, Error = Error> + Clone,
B: Body<Data = Bytes> + Send + 'static,
B::Data: Send,
B::Error: Into<BoxError>,
pub fn build<S, B>(
self,
target: impl AsRef<str>,
) -> Result<HttpTransportClient<S>, Error>where
L: Layer<HttpBackend, Service = S>,
S: Service<HttpRequest, Response = HttpResponse<B>, Error = Error> + Clone,
B: Body<Data = Bytes> + Send + 'static,
B::Data: Send,
B::Error: Into<BoxError>,
Build a HttpTransportClient
.