Understand Tungstenite's design and use cases
masterTungstenite is a lightweight, stream-based WebSocket implementation of [RFC6455].
Key Characteristics:
- Synchronous/Asynchronous: It supports both synchronous usage (similar to
TcpStream) and asynchronous usage. It is designed to be easily integrated into third-party event loops like [MIO]. - Low-level Control: The API abstracts the WebSocket protocol internals while still providing access for users who require full control over the network.
- When to use something else: Tungstenite is a 'barebone' library. If you require a production-ready, 'batteries included' library for non-blocking sockets and full-duplex communication, use
tokio-tungsteniteinstead.