stream-tungstenite 0.6.1

A streaming implementation of the Tungstenite WebSocket protocol
Documentation
//! Connection management module.
//!
//! This module provides the core connection management functionality:
//!
//! - **Connector**: Establishes WebSocket connections
//! - **Supervisor**: Manages connection lifecycle and reconnection
//! - **State**: Tracks connection status and metrics
//! - **Retry**: Implements retry strategies
//!
//! # Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────┐
//! │                  ConnectionSupervisor                        │
//! │                                                              │
//! │  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐ │
//! │  │  Connector  │  │   State     │  │   RetryStrategy     │ │
//! │  │             │  │             │  │                     │ │
//! │  │ connect()   │  │ status      │  │ next_delay()        │ │
//! │  │             │  │ id          │  │ reset()             │ │
//! │  └─────────────┘  │ metrics     │  └─────────────────────┘ │
//! │                   └─────────────┘                           │
//! │                                                              │
//! │  Events: Connecting → Connected → Disconnected → Reconnect  │
//! └─────────────────────────────────────────────────────────────┘
//! ```
//!
//! # Example
//!
//! ```rust,ignore
//! use stream_tungstenite::connection::{
//!     ConnectionSupervisor, SupervisorConfig, ExponentialBackoff
//! };
//!
//! // Create a supervisor with custom retry strategy
//! let config = SupervisorConfig::new()
//!     .with_retry(ExponentialBackoff::fast());
//!
//! let supervisor = ConnectionSupervisor::new("wss://example.com/ws")
//!     .with_config(config);
//!
//! // Subscribe to events
//! let mut events = supervisor.subscribe();
//!
//! // Connect
//! let stream = supervisor.connect().await?;
//! ```

mod connector;
mod retry;
mod state;
mod supervisor;

pub use connector::{
    ConnectionInfo, Connector, DefaultConnector, DefaultWsStream, TransportConnector, WsStream,
};
pub use retry::{CustomRetry, ExponentialBackoff, FixedDelay, NoRetry, RetryStrategy};
pub use state::{ConnectionSnapshot, ConnectionState, ConnectionStatus};
pub use supervisor::{ActivityHandle, ConnectionEvent, ConnectionSupervisor, SupervisorConfig};