stream-tungstenite 0.6.1

A streaming implementation of the Tungstenite WebSocket protocol
Documentation
//! Handshake module for application-level WebSocket handshakes.
//!
//! This module provides abstractions for performing custom handshake logic
//! after the WebSocket connection is established. Common use cases include:
//!
//! - Authentication
//! - Channel subscription
//! - Protocol negotiation
//!
//! # Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────┐
//! │                    Handshake Layer                          │
//! │                                                              │
//! │  ┌──────────────┐  ┌──────────────┐  ┌──────────────────┐  │
//! │  │  NoOp        │  │  Auth        │  │  Subscribe       │  │
//! │  │  Handshaker  │  │  Handshaker  │  │  Handshaker      │  │
//! │  └──────────────┘  └──────────────┘  └──────────────────┘  │
//! │                           │                                  │
//! │                           ▼                                  │
//! │                  ┌──────────────────┐                       │
//! │                  │ ChainedHandshaker│                       │
//! │                  │ (combines them)  │                       │
//! │                  └──────────────────┘                       │
//! └─────────────────────────────────────────────────────────────┘
//! ```
//!
//! # Example
//!
//! ```rust,ignore
//! use stream_tungstenite::handshake::{
//!     ChainedHandshaker, AuthHandshaker, SubscribeHandshaker
//! };
//!
//! // Create a chained handshaker that:
//! // 1. Authenticates with a token
//! // 2. Subscribes to multiple channels
//! let handshaker = ChainedHandshaker::new()
//!     .then(AuthHandshaker::new("my-api-key").json())
//!     .then(SubscribeHandshaker::new(vec!["trades", "orderbook"]));
//!
//! // Or use the macro
//! let handshaker = chain_handshakers!(
//!     AuthHandshaker::new("my-api-key").json(),
//!     SubscribeHandshaker::new(vec!["trades", "orderbook"]),
//! );
//! ```

mod chained;
mod common;
mod noop;
mod traits;

pub use chained::ChainedHandshaker;
pub use common::{
    AuthFormat, AuthHandshaker, SendMessageHandshaker, SubscribeFormat, SubscribeHandshaker,
};
pub use noop::NoOpHandshaker;
pub use traits::{boxed, BoxHandshaker, HandshakeReceiver, HandshakeSender, Handshaker};