Docs.rs
  • async-tungstenite-0.28.0
    • async-tungstenite 0.28.0
    • Docs.rs crate page
    • MIT
    • Links
    • Homepage
    • Repository
    • crates.io
    • Source
    • Owners
    • sdroege
    • tp-m
    • Dependencies
      • async-std ^1.0 normal optional
      • futures-io ^0.3 normal
      • futures-util ^0.3 normal
      • gio ^0.20 normal optional
      • glib ^0.20 normal optional
      • log ^0.4 normal
      • openssl ^0.10 normal optional
      • pin-project-lite ^0.2 normal
      • async-native-tls ^0.5.0 normal optional
      • async-tls ^0.13 normal optional
      • native-tls ^0.2 normal optional
      • tokio-native-tls ^0.3 normal optional
      • tokio-openssl ^0.6 normal optional
      • tokio-rustls ^0.26 normal optional
      • rustls-native-certs ^0.8 normal optional
      • rustls-pki-types ^1.0.1 normal optional
      • tokio ^1.0 normal optional
      • tungstenite ^0.24 normal
      • webpki-roots ^0.26 normal optional
      • async-std ^1.0 dev
      • env_logger ^0.10 dev
      • futures ^0.3 dev
      • futures-channel ^0.3 dev
      • http-body-util ^0.1 dev
      • hyper ^1.0 dev
      • hyper-util ^0.1 dev
      • tokio ^1.0 dev
      • tungstenite ^0.24 dev
      • url ^2.0.0 dev
    • Versions
    • 100% of the crate is documented
  • Go to latest version
  • Platform
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Badges
    • Builds
    • Metadata
    • Shorthand URLs
    • Download
    • Rustdoc JSON
    • Build queue
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate async_tungstenite

async_tungstenite0.28.0

  • All Items
  • Re-exports
  • Modules
  • Structs
  • Functions

Crates

  • async_tungstenite
?
Settings

Crate async_tungstenite

source ·
Expand description

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 the async_tls module, which provides integration with the async-tls TLS stack and can be used independent of any async runtime.
  • async-std-runtime: Enables the async_std module, which provides integration with the async-std runtime.
  • async-native-tls: Enables the additional functions in the async_std module to implement TLS via async-native-tls.
  • tokio-runtime: Enables the tokio module, which provides integration with the tokio runtime.
  • tokio-native-tls: Enables the additional functions in the tokio module to implement TLS via tokio-native-tls.
  • tokio-rustls-native-certs: Enables the additional functions in the tokio module to implement TLS via tokio-rustls and uses native system certificates found with rustls-native-certs.
  • tokio-rustls-webpki-roots: Enables the additional functions in the tokio module to implement TLS via tokio-rustls and uses the certificates webpki-roots provides.
  • tokio-openssl: Enables the additional functions in the tokio module to implement TLS via tokio-openssl.
  • gio-runtime: Enables the gio module, 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-std integration.
  • async_tls
    async-tls integration.
  • gio
    gio integration.
  • stream
    Convenience wrapper for streams to switch between plain TCP and TLS at runtime.
  • tokio
    tokio integration.

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_async() but the one can specify a websocket configuration. Please refer to accept_async() for more details.
  • accept_hdr_async
    Accepts a new WebSocket connection with the provided stream.
  • accept_hdr_async_with_config
    The same as accept_hdr_async() but the one can specify a websocket configuration. Please refer to accept_hdr_async() for more details.
  • 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 Request. Calling with Request allows the user to add a WebSocket protocol or other custom headers.
  • client_async_with_config
    The same as client_async() but the one can specify a websocket configuration. Please refer to client_async() for more details.

Results

type alias
async_tungstenite::async_std::ConnectStream
Type alias for the stream type of the connect_async() …
type alias
async_tungstenite::gio::ConnectStream
Type alias for the stream type of the connect_async() …
type alias
async_tungstenite::tokio::ConnectStream
Type alias for the stream type of the connect_async() …
type alias
async_tungstenite::async_std::ClientStream
Type alias for the stream type of the client_async() …
type alias
async_tungstenite::async_tls::ClientStream
Type alias for the stream type of the client_async() …
type alias
async_tungstenite::tokio::ClientStream
Type alias for the stream type of the client_async() …
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.
function
async_tungstenite::async_std::connect_async
Connect to a given URL.
function
async_tungstenite::gio::connect_async
Connect to a given URL.
function
async_tungstenite::tokio::connect_async
Connect to a given URL.
function
async_tungstenite::async_std::connect_async_with_config
Connect to a given URL with a given WebSocket …
function
async_tungstenite::gio::connect_async_with_config
Connect to a given URL with a given WebSocket …
function
async_tungstenite::tokio::connect_async_with_config
Connect to a given URL with a given WebSocket …
function
async_tungstenite::async_std::connect_async_with_tls_connector
Connect to a given URL using the provided TLS connector.
function
async_tungstenite::tokio::connect_async_with_tls_connector
Connect to a given URL using the provided TLS connector.
function
async_tungstenite::async_std::connect_async_with_tls_connector_and_config
Connect to a given URL using the provided TLS connector.
function
async_tungstenite::tokio::connect_async_with_tls_connector_and_config
Connect to a given URL using the provided TLS connector.