pub struct WsTransportClientBuilder {
pub certificate_store: CertificateStore,
pub connection_timeout: Duration,
pub headers: HeaderMap,
pub max_request_size: u32,
pub max_response_size: u32,
pub max_redirections: usize,
pub tcp_no_delay: bool,
}
ws
only.Fields§
§certificate_store: CertificateStore
What certificate store to use
connection_timeout: Duration
Timeout for the connection.
headers: HeaderMap
Custom headers to pass during the HTTP handshake.
max_request_size: u32
Max request payload size
max_response_size: u32
Max response payload size
max_redirections: usize
Max number of redirections.
tcp_no_delay: bool
TCP no delay.
Implementations§
source§impl WsTransportClientBuilder
impl WsTransportClientBuilder
sourcepub fn with_custom_cert_store(self, cfg: CustomCertStore) -> Self
pub fn with_custom_cert_store(self, cfg: CustomCertStore) -> Self
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 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 connection_timeout(self, timeout: Duration) -> Self
pub fn connection_timeout(self, timeout: Duration) -> Self
Set connection timeout for the handshake (default is 10 seconds).
sourcepub fn set_headers(self, headers: HeaderMap) -> Self
pub fn set_headers(self, headers: HeaderMap) -> Self
Set a custom header passed to the server during the handshake (default is none).
The caller is responsible for checking that the headers do not conflict or are duplicated.
sourcepub fn max_redirections(self, redirect: usize) -> Self
pub fn max_redirections(self, redirect: usize) -> Self
Set the max number of redirections to perform until a connection is regarded as failed. (default is 5).
source§impl WsTransportClientBuilder
impl WsTransportClientBuilder
sourcepub async fn build(
self,
uri: Url,
) -> Result<(Sender<Compat<EitherStream>>, Receiver<Compat<EitherStream>>), WsHandshakeError>
pub async fn build( self, uri: Url, ) -> Result<(Sender<Compat<EitherStream>>, Receiver<Compat<EitherStream>>), WsHandshakeError>
Try to establish the connection.
Uses the default connection over TCP.
sourcepub async fn build_with_stream<T>(
self,
uri: Url,
data_stream: T,
) -> Result<(Sender<Compat<T>>, Receiver<Compat<T>>), WsHandshakeError>
pub async fn build_with_stream<T>( self, uri: Url, data_stream: T, ) -> Result<(Sender<Compat<T>>, Receiver<Compat<T>>), WsHandshakeError>
Try to establish the connection over the given data stream.