pub struct TungsteniteTransport { /* private fields */ }Expand description
The native transport: tokio-tungstenite over TCP, with TLS from rustls.
It installs the rustls CryptoProvider before it dials
(ensure_crypto_provider), since a
consumer that builds two rustls backends gets no default and a direct
connect would panic. Its capabilities are all true.
Implementations§
Source§impl TungsteniteTransport
impl TungsteniteTransport
Sourcepub const fn new() -> Self
pub const fn new() -> Self
The plain dial: tungstenite’s own connect, which resolves the host and connects to the first address it returns.
Sourcepub const fn per_address() -> Self
pub const fn per_address() -> Self
The dial of a host that has several addresses, some of which may not
answer: it resolves every address up front, tries each in
family-interleaved order (IPv6 and IPv4 alternating, RFC 8305 section 4),
and bounds the TCP connect and, separately, the TLS and WebSocket
upgrade of each by the connect timeout, so a blackholed route costs one
timeout and not one per address. It falls back to the next address on
any failure but a refused upgrade, which it returns at once: another
address would repeat the refusal, and its own failure would hide this
one’s status and Retry-After.
Trait Implementations§
Source§impl Clone for TungsteniteTransport
impl Clone for TungsteniteTransport
impl Copy for TungsteniteTransport
Source§impl Debug for TungsteniteTransport
impl Debug for TungsteniteTransport
Source§impl Default for TungsteniteTransport
impl Default for TungsteniteTransport
Source§impl SocketTransport for TungsteniteTransport
Available on non-WebAssembly only.
impl SocketTransport for TungsteniteTransport
Source§fn connect(
&self,
request: Request<()>,
timeout: Duration,
runtime: Arc<dyn Runtime>,
) -> BoxFuture<Result<BoxSocket, WsError>>
fn connect( &self, request: Request<()>, timeout: Duration, runtime: Arc<dyn Runtime>, ) -> BoxFuture<Result<BoxSocket, WsError>>
request describes, within timeout.