web_transport_ws/
client.rs1#[deprecated(note = "use qmux::ws::Client instead")]
7#[derive(Default, Clone)]
8pub struct Client {
9 inner: qmux::ws::Client,
10}
11
12#[allow(deprecated)]
13impl Client {
14 pub fn new() -> Self {
15 Self::default()
16 }
17
18 pub fn with_protocol(mut self, protocol: &str) -> Self {
20 self.inner = self.inner.with_protocol(protocol);
21 self
22 }
23
24 pub fn with_protocols(mut self, protocols: &[&str]) -> Self {
26 self.inner = self.inner.with_protocols(protocols);
27 self
28 }
29
30 pub fn with_config(mut self, config: qmux::tungstenite::protocol::WebSocketConfig) -> Self {
32 self.inner = self.inner.with_config(config);
33 self
34 }
35
36 #[cfg(any(
38 feature = "rustls-tls-native-roots",
39 feature = "rustls-tls-webpki-roots"
40 ))]
41 pub fn with_connector(mut self, connector: qmux::tokio_tungstenite::Connector) -> Self {
42 self.inner = self.inner.with_connector(connector);
43 self
44 }
45
46 pub async fn connect(&self, url: &str) -> Result<qmux::Session, qmux::Error> {
48 self.inner.connect(url).await
49 }
50}