|
|
|
@ -18,7 +18,7 @@ use std::io::{Read, Write}; |
|
|
|
|
/// If you want TLS support, use `native_tls::TlsStream` or `openssl::ssl::SslStream`
|
|
|
|
|
/// for the stream here. Any `Read + Write` streams are supported, including
|
|
|
|
|
/// those from `Mio` and others.
|
|
|
|
|
pub fn accept_with_config<S: Read + Write>( |
|
|
|
|
pub fn accept_with_config<S: Read + Write + Unpin>( |
|
|
|
|
stream: S, |
|
|
|
|
config: Option<WebSocketConfig>, |
|
|
|
|
) -> Result<WebSocket<S>, HandshakeError<ServerHandshake<S, NoCallback>>> { |
|
|
|
@ -31,7 +31,7 @@ pub fn accept_with_config<S: Read + Write>( |
|
|
|
|
/// If you want TLS support, use `native_tls::TlsStream` or `openssl::ssl::SslStream`
|
|
|
|
|
/// for the stream here. Any `Read + Write` streams are supported, including
|
|
|
|
|
/// those from `Mio` and others.
|
|
|
|
|
pub fn accept<S: Read + Write>( |
|
|
|
|
pub fn accept<S: Read + Write + Unpin>( |
|
|
|
|
stream: S, |
|
|
|
|
) -> Result<WebSocket<S>, HandshakeError<ServerHandshake<S, NoCallback>>> { |
|
|
|
|
accept_with_config(stream, None) |
|
|
|
@ -45,7 +45,7 @@ pub fn accept<S: Read + Write>( |
|
|
|
|
/// This function does the same as `accept()` but accepts an extra callback
|
|
|
|
|
/// for header processing. The callback receives headers of the incoming
|
|
|
|
|
/// requests and is able to add extra headers to the reply.
|
|
|
|
|
pub fn accept_hdr_with_config<S: Read + Write, C: Callback>( |
|
|
|
|
pub fn accept_hdr_with_config<S: Read + Write + Unpin, C: Callback>( |
|
|
|
|
stream: S, |
|
|
|
|
callback: C, |
|
|
|
|
config: Option<WebSocketConfig>, |
|
|
|
@ -58,7 +58,7 @@ pub fn accept_hdr_with_config<S: Read + Write, C: Callback>( |
|
|
|
|
/// This function does the same as `accept()` but accepts an extra callback
|
|
|
|
|
/// for header processing. The callback receives headers of the incoming
|
|
|
|
|
/// requests and is able to add extra headers to the reply.
|
|
|
|
|
pub fn accept_hdr<S: Read + Write, C: Callback>( |
|
|
|
|
pub fn accept_hdr<S: Read + Write + Unpin, C: Callback>( |
|
|
|
|
stream: S, |
|
|
|
|
callback: C, |
|
|
|
|
) -> Result<WebSocket<S>, HandshakeError<ServerHandshake<S, C>>> { |
|
|
|
|