[−][src]Crate async_tungstenite
Async WebSockets.
This crate is based on tungstenite
Rust WebSocket library and provides async bindings and wrappers for it, so you
can use it with non-blocking/asynchronous TcpStreams from and couple it
together with other crates from the async stack. In addition, optional
integration with various other crates can be enabled via feature flags
async-tls: Enables theasync_tlsmodule, which provides integration with the async-tls TLS stack and can be used independent of any async runtime.async-std-runtime: Enables theasync_stdmodule, which provides integration with the async-std runtime.async-native-tls: Enables the additional functions in theasync_stdmodule to implement TLS via async-native-tls.tokio-runtime: Enables thetokiomodule, which provides integration with the tokio runtime.tokio-tls: Enables the additional functions in thetokiomodule to implement TLS via tokio-tls.gio-runtime: Enables thegiomodule, which provides integration with the gio runtime.
Each WebSocket stream implements the required Stream and Sink traits,
making the socket a stream of WebSocket messages coming in and going out.
Re-exports
pub use tungstenite; |
Modules
| async_std |
|
| async_tls |
|
| gio |
|
| stream | Convenience wrapper for streams to switch between plain TCP and TLS at runtime. |
| tokio |
|
Structs
| WebSocketStream | A wrapper around an underlying raw stream which implements the WebSocket protocol. |
Functions
| accept_async | Accepts a new WebSocket connection with the provided stream. |
| accept_async_with_config | The same as |
| accept_hdr_async | Accepts a new WebSocket connection with the provided stream. |
| accept_hdr_async_with_config | The same as |
| client_async | Creates a WebSocket handshake from a request and a stream.
For convenience, the user may call this with a url string, a URL,
or a |
| client_async_with_config | The same as |