pub struct ClientBuilder { /* private fields */ }Expand description
Builder for creating a WebSocket client.
The resulting client can be reused for multiple connect() calls.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn with_options(self, opts: ConnectOptions) -> Self
pub fn with_options(self, opts: ConnectOptions) -> Self
Replace the builder options wholesale.
Sourcepub fn options(&self) -> &ConnectOptions
pub fn options(&self) -> &ConnectOptions
Return a reference to the current options.
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Add a single header to the connection request.
Sourcepub fn with_headers<I, K, V>(self, headers: I) -> Self
pub fn with_headers<I, K, V>(self, headers: I) -> Self
Add multiple headers to the connection request.
Sourcepub fn with_limits(self, limits: WebSocketLimits) -> Self
pub fn with_limits(self, limits: WebSocketLimits) -> Self
Configure WebSocket message resource limits.
Sourcepub fn with_protocol(self, protocol: impl Into<String>) -> Self
pub fn with_protocol(self, protocol: impl Into<String>) -> Self
Add a single subprotocol.
Sourcepub fn with_protocols<I, P>(self, protocols: I) -> Self
pub fn with_protocols<I, P>(self, protocols: I) -> Self
Add multiple subprotocols.
Sourcepub fn with_system_roots(self) -> Result<Client>
pub fn with_system_roots(self) -> Result<Client>
Build a client using system roots (no-op in the browser).
Sourcepub fn with_server_certificates<I>(self, _chain: I) -> Result<Client>
pub fn with_server_certificates<I>(self, _chain: I) -> Result<Client>
Attempt to configure custom certificates (not supported in the browser).
Sourcepub fn dangerous(self) -> DangerousClientBuilder
pub fn dangerous(self) -> DangerousClientBuilder
Enter the “dangerous” builder that can disable certificate verification.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClientBuilder
impl Debug for ClientBuilder
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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