pub async fn with_timeout<F: Future>(
timeout: Duration,
connect: F,
) -> Result<F::Output, WsError>Expand description
Run a caller’s own connect future, giving up after timeout with
Kind::ConnectTimeout.
The future’s own output comes back as it is, so its errors stay the
caller’s. It runs on the target’s default runtime; a transport bounds its
own steps on the runtime it is given instead. Install the rustls provider
before a TLS connect of its own
(ensure_crypto_provider).