rat_congestion 0.1.0

High-performance congestion control algorithms for network protocols
Documentation
//! # RAT Congestion Control Library
//!
//! A high-performance, platform-optimized congestion control library implementing
//! BBR and CUBIC algorithms with intelligent switching capabilities.
//!
//! This library is designed as a pure computational engine that processes network
//! data provided by the caller, without collecting any system data itself.
//!
//! ## Features
//!
//! - **Pure Computation**: No system data collection, all data provided by caller
//! - **BBR Algorithm**: Google's Bottleneck Bandwidth and Round-trip propagation time algorithm
//! - **CUBIC Algorithm**: High-performance CUBIC congestion control with optimizations
//! - **Intelligent Switching**: Dynamic algorithm selection based on network conditions
//! - **Platform Optimizations**: Automatic platform detection and SIMD optimizations
//! - **Zero-Copy Design**: Minimal allocations and efficient batch processing
//! - **Unified Entry Point**: Single API for all platforms, auto-configured
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use rat_congestion::{CongestionController, PacketEvent};
//! use std::time::Duration;
//!
//! // Create a controller with automatic platform optimization
//! // Note: In real usage, you need to provide NetworkMetrics and MetricsWindow implementations
//! // let mut controller = CongestionController::new(metrics, metrics_window);
//! ```
//!
//! ## Advanced Usage
//!
//! ```rust,no_run
//! use rat_congestion::{CongestionController, ControllerConfig};
//!
//! // Create with custom configuration
//! let config = ControllerConfig::builder()
//!     .initial_algorithm("bbr")
//!     .auto_switching(true)
//!     .build();
//!
//! // Note: In real usage, you need to provide NetworkMetrics and MetricsWindow implementations
//! // let mut controller = CongestionController::with_config(config, metrics, metrics_window);
//! ```

// Core modules
mod algorithms;
mod constants;
mod events;
mod manager;
mod platform;

// Public unified API
mod controller;

// Main public API - unified entry point
pub use controller::{CongestionController, ControllerConfig, ControllerConfigBuilder};

// Advanced API for power users
pub use algorithms::{CongestionControlAlgorithm, Bbr, Cubic};
pub use events::CongestionEvent;
pub use manager::{CongestionManager, CongestionConfig, AlgorithmType, NetworkMetrics, MetricsWindow};


// Platform information (read-only)
pub use platform::detection::PLATFORM;

// Essential constants
pub use constants::perf::{INITIAL_CWND, MIN_CWND, DEFAULT_MSS};

// Convenience type aliases
pub type PacketEvent = CongestionEvent;
pub type WindowSize = u64;
pub type PacingRate = u64;