Struct ratchet_rs::WebSocketServerBuilder [−][src]
pub struct WebSocketServerBuilder<E> { /* fields omitted */ }
Expand description
A builder to construct WebSocket servers.
If a lot of connections will be negotiated it is more efficient to directly use accept_with
than this builder as it is possible for accept_with
to borrow the extension provider and
protocol registry.
Implementations
pub async fn accept<S>(
self,
stream: S
) -> Result<UpgradedServer<S, <E as ExtensionProvider>::Extension>, Error> where
S: WebSocketStream,
E: ExtensionProvider,
pub async fn accept<S>(
self,
stream: S
) -> Result<UpgradedServer<S, <E as ExtensionProvider>::Extension>, Error> where
S: WebSocketStream,
E: ExtensionProvider,
Accept stream
and perform a server WebSocket handshake.
Sets the configuration that will be used for the connection.
pub fn extension<T>(self, extension: T) -> WebSocketServerBuilder<T> where
T: ExtensionProvider,
pub fn extension<T>(self, extension: T) -> WebSocketServerBuilder<T> where
T: ExtensionProvider,
Sets the extension that will be used for the connection.
pub fn subprotocols<I>(
self,
subprotocols: I
) -> Result<WebSocketServerBuilder<E>, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<Cow<'static, str>>,
pub fn subprotocols<I>(
self,
subprotocols: I
) -> Result<WebSocketServerBuilder<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