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_max_logging_length(self, max: u32) -> Self
pub fn set_max_logging_length(self, max: u32) -> Self
Max length for logging for requests and responses in number characters.
Logs bigger than this limit will be truncated.
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
.
Trait Implementations§
source§impl<L: Debug> Debug for HttpTransportClientBuilder<L>
impl<L: Debug> Debug for HttpTransportClientBuilder<L>
Auto Trait Implementations§
impl<L> Freeze for HttpTransportClientBuilder<L>where
L: Freeze,
impl<L> !RefUnwindSafe for HttpTransportClientBuilder<L>
impl<L> Send for HttpTransportClientBuilder<L>where
L: Send,
impl<L> Sync for HttpTransportClientBuilder<L>where
L: Sync,
impl<L> Unpin for HttpTransportClientBuilder<L>where
L: Unpin,
impl<L> !UnwindSafe for HttpTransportClientBuilder<L>
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