1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! 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"]),
//! );
//! ```
pub use ChainedHandshaker;
pub use ;
pub use NoOpHandshaker;
pub use ;