pub struct AsyncWebsocketClientBuilder<GraphqlClient, Payload = NoPayload> where
GraphqlClient: GraphqlClient + Send + 'static, { /* private fields */ }
Expand description
A websocket client builder
Implementations
impl<GraphqlClient, Payload> AsyncWebsocketClientBuilder<GraphqlClient, Payload> where
GraphqlClient: GraphqlClient + Send + 'static,
impl<GraphqlClient, Payload> AsyncWebsocketClientBuilder<GraphqlClient, Payload> where
GraphqlClient: GraphqlClient + Send + 'static,
impl<GraphqlClient, Payload> AsyncWebsocketClientBuilder<GraphqlClient, Payload> where
GraphqlClient: GraphqlClient + Send + 'static,
Payload: Serialize,
impl<GraphqlClient, Payload> AsyncWebsocketClientBuilder<GraphqlClient, Payload> where
GraphqlClient: GraphqlClient + Send + 'static,
Payload: Serialize,
pub async fn build<WsMessage>(
self,
websocket_stream: impl Stream<Item = Result<WsMessage, WsMessage::Error>> + Unpin + Send + 'static,
websocket_sink: impl Sink<WsMessage, Error = WsMessage::Error> + Unpin + Send + 'static,
runtime: impl SpawnExt
) -> Result<AsyncWebsocketClient<GraphqlClient, WsMessage>, Error> where
GraphqlClient: GraphqlClient + Send + 'static,
WsMessage: WebsocketMessage + Send + 'static,
pub async fn build<WsMessage>(
self,
websocket_stream: impl Stream<Item = Result<WsMessage, WsMessage::Error>> + Unpin + Send + 'static,
websocket_sink: impl Sink<WsMessage, Error = WsMessage::Error> + Unpin + Send + 'static,
runtime: impl SpawnExt
) -> Result<AsyncWebsocketClient<GraphqlClient, WsMessage>, Error> where
GraphqlClient: GraphqlClient + Send + 'static,
WsMessage: WebsocketMessage + Send + 'static,
Constructs an AsyncWebsocketClient
Accepts a stream and a sink for the underlying websocket connection,
and an async_executors::SpawnHandle
that tells the client which
async runtime to use.