pub struct WebSocketTransport { /* private fields */ }Expand description
The built-in transport: tokio-tungstenite over rustls, trusting the platform’s root
certificates. It handles the upgrade handshake, answers pings, and reassembles
fragmented messages. The request carries User-Agent: actioncable/<version> unless the
caller set one, and never negotiates extensions.
Implementations§
Source§impl WebSocketTransport
impl WebSocketTransport
Sourcepub fn new() -> WebSocketTransport
pub fn new() -> WebSocketTransport
The transport with its defaults: a ten second handshake, a ten second write, and messages up to 8 MiB.
Sourcepub fn handshake_timeout(self, timeout: Duration) -> WebSocketTransport
pub fn handshake_timeout(self, timeout: Duration) -> WebSocketTransport
Bounds the TCP connect, the TLS handshake and the upgrade together. Ten seconds by default.
Sourcepub fn write_timeout(self, timeout: Duration) -> WebSocketTransport
pub fn write_timeout(self, timeout: Duration) -> WebSocketTransport
Bounds one write. A peer that has stopped reading would otherwise hold a perform
forever; past the timeout the write fails and the connection is dropped and redialed,
the same as a failed read. Ten seconds by default.
Sourcepub fn max_message_size(self, bytes: usize) -> WebSocketTransport
pub fn max_message_size(self, bytes: usize) -> WebSocketTransport
The largest message accepted, in bytes. 8 MiB by default.
Trait Implementations§
Source§impl Clone for WebSocketTransport
impl Clone for WebSocketTransport
Source§impl Debug for WebSocketTransport
impl Debug for WebSocketTransport
Source§impl Default for WebSocketTransport
impl Default for WebSocketTransport
Source§fn default() -> WebSocketTransport
fn default() -> WebSocketTransport
Source§impl Transport for WebSocketTransport
impl Transport for WebSocketTransport
Source§fn dial<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
options: DialOptions,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Conn>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn dial<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
options: DialOptions,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Conn>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
options carries the subprotocols the client’s protocols
negotiate under and the headers that authorize the request.