[−][src]Type Definition websocket::client::async::ClientNew
type ClientNew<S> = Box<dyn Future<Item = (Client<S>, Headers), Error = WebSocketError> + Send>;
A future which will evaluate to a Client
and a set of hyper Headers
.
The Client
can send and receive websocket messages, and the Headers are
the headers that came back from the server handshake.
If the user used a protocol or attached some other headers check these response
headers to see if the server accepted the protocol or other custom header.
This crate will not automatically close the connection if the server refused
to use the user protocols given to it, you must check that the server accepted.