Struct ratchet_rs::WebSocketClientBuilder
source · [−]pub struct WebSocketClientBuilder<E> { /* private fields */ }
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
sourceimpl<E> WebSocketClientBuilder<E>
impl<E> WebSocketClientBuilder<E>
sourcepub 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
sourcepub fn config(self, config: WebSocketConfig) -> WebSocketClientBuilder<E>
pub fn config(self, config: WebSocketConfig) -> WebSocketClientBuilder<E>
Sets the configuration that will be used for the connection.
sourcepub 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.
sourcepub 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
sourceimpl<E> Debug for WebSocketClientBuilder<E> where
E: Debug,
impl<E> Debug for WebSocketClientBuilder<E> where
E: Debug,
sourceimpl Default for WebSocketClientBuilder<NoExtProvider>
impl Default for WebSocketClientBuilder<NoExtProvider>
sourcefn default() -> WebSocketClientBuilder<NoExtProvider>
fn default() -> WebSocketClientBuilder<NoExtProvider>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<E> RefUnwindSafe for WebSocketClientBuilder<E> where
E: RefUnwindSafe,
impl<E> Send for WebSocketClientBuilder<E> where
E: Send,
impl<E> Sync for WebSocketClientBuilder<E> where
E: Sync,
impl<E> Unpin for WebSocketClientBuilder<E> where
E: Unpin,
impl<E> UnwindSafe for WebSocketClientBuilder<E> where
E: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more