Struct ratchet_rs::WebSocketClientBuilder [−][src]
pub struct WebSocketClientBuilder<E> { /* fields omitted */ }
Expand description
A builder to construct WebSocket clients.
If a lot of connections will be negotiated it is more efficient to directly use subscribe_with
than this builder as it is possible for subscribe_with
to borrow the extension provider and
protocol registry.
Implementations
pub async fn subscribe<S, I>(
self,
stream: S,
request: I
) -> Result<UpgradedClient<S, <E as ExtensionProvider>::Extension>, Error> where
S: WebSocketStream,
I: TryIntoRequest,
E: ExtensionProvider,
pub async fn subscribe<S, I>(
self,
stream: S,
request: I
) -> Result<UpgradedClient<S, <E as ExtensionProvider>::Extension>, Error> where
S: WebSocketStream,
I: TryIntoRequest,
E: ExtensionProvider,
Attempt to execute a client handshake
Sets the configuration that will be used for the connection.
pub fn extension<T>(self, extension: T) -> WebSocketClientBuilder<T> where
T: ExtensionProvider,
pub fn extension<T>(self, extension: T) -> WebSocketClientBuilder<T> where
T: ExtensionProvider,
Sets the extension that will be used for the connection.
pub fn subprotocols<I>(
self,
subprotocols: I
) -> Result<WebSocketClientBuilder<E>, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<Cow<'static, str>>,
pub fn subprotocols<I>(
self,
subprotocols: I
) -> Result<WebSocketClientBuilder<E>, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<Cow<'static, str>>,
Sets the subprotocols that will be used for the connection.
Trait Implementations
Returns the “default value” for a type. Read more