Type Alias async_web_server::WsConnection
source · pub type WsConnection<IO = TcpOrTlsStream> = WsConnection<IO>;
Aliased Type§
struct WsConnection<IO = TcpOrTlsStream> { /* private fields */ }
Implementations
source§impl<T> WsConnection<T>where
T: AsyncRead + AsyncWrite + Unpin,
impl<T> WsConnection<T>where T: AsyncRead + AsyncWrite + Unpin,
pub fn with_config(transport: T, config: WsConfig) -> WsConnection<T>
pub fn send(&self, kind: WsMessageKind) -> WsSend<T> ⓘ
pub fn err(&self) -> Option<Arc<WsConnectionError>>
Trait Implementations
source§impl<T> Stream for WsConnection<T>where
T: AsyncRead + AsyncWrite + Unpin,
impl<T> Stream for WsConnection<T>where T: AsyncRead + AsyncWrite + Unpin,
§type Item = WsMessageReader<T>
type Item = WsMessageReader<T>
Values yielded by the stream.
source§fn poll_next(
self: Pin<&mut WsConnection<T>>,
cx: &mut Context<'_>
) -> Poll<Option<<WsConnection<T> as Stream>::Item>>
fn poll_next( self: Pin<&mut WsConnection<T>>, cx: &mut Context<'_> ) -> Poll<Option<<WsConnection<T> as Stream>::Item>>
Attempt to pull out the next value of this stream, registering the
current task for wakeup if the value is not yet available, and returning
None
if the stream is exhausted. Read more