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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//! Transport layer for OMNI-MESH runtime.
//!
//! This module provides pluggable transport implementations for message delivery
//! over various network protocols. The transport layer is designed to be:
//!
//! - **Extensible**: Easy to add new transport protocols
//! - **Configurable**: Network settings can be customized per deployment
//! - **Testable**: Mock transport for development and testing
//! - **Async**: Built on Tokio for high-performance I/O
//!
//! ## Architecture
//!
//! The transport layer follows a trait-based design:
//!
//! - [`Transport`] trait defines the interface for all transport implementations
//! - [`TransportLayer`] provides a facade over concrete transport types
//! - Mode-based selection automatically chooses the appropriate transport
//!
//! ## Transport Types
//!
//! - **Mock**: For testing and development (no network I/O)
//! - **TCP**: Reliable, ordered delivery over TCP
//! - **QUIC**: Secure, multiplexed delivery over QUIC
//!
//! ## Usage Examples
//!
//! ### Basic Usage
//! ```rust,ignore
//! use omnimesh::runtime::transport::TransportLayer;
//! use omnimesh::config::OmnimeshMode;
//!
//! let mode = OmnimeshMode::development();
//! let transport = TransportLayer::new(&mode)?;
//! transport.initialize()?;
//!
//! if let Some(envelope) = transport.receive() {
//! println!("Received envelope: {:?}", envelope.header);
//! }
//! ```
//!
//! ### Custom Configuration
//! ```rust,ignore
//! use omnimesh::runtime::transport::{TransportLayer, TransportConfig};
//! use omnimesh::config::OmnimeshMode;
//!
//! let config = TransportConfig::new(
//! "0.0.0.0:8001".parse()?,
//! "127.0.0.1:8001".parse()?,
//! "0.0.0.0:4433".parse()?,
//! );
//!
//! let transport = TransportLayer::with_config(
//! &OmnimeshMode::lightweight(),
//! config
//! )?;
//! ```
//!
//! ### Mode-Based Selection
//! ```rust,ignore
//! use omnimesh::runtime::transport::TransportLayer;
//! use omnimesh::config::OmnimeshMode;
//!
//! // Automatically selects mock transport
//! let dev = TransportLayer::new(&OmnimeshMode::development())?;
//!
//! // Automatically selects TCP transport
//! let light = TransportLayer::new(&OmnimeshMode::lightweight())?;
//!
//! // Automatically selects QUIC transport
//! let prod = TransportLayer::new(&OmnimeshMode::production())?;
//! ```
//!
//! ## Module Organization
//!
//! - [`interface`] - Core `Transport` trait
//! - [`config`] - Network configuration
//! - [`mock`] - Mock transport for testing
//! - [`tcp`] - TCP transport using Tokio
//! - [`quic`] - QUIC transport using Quinn
//! - [`layer`] - Transport facade and factory
//! - [`common`] - Shared utilities
//! - [`cert`] - Certificate utilities
//! - [`compression`] - Optional message compression
//! - [`tests`] - Integration tests
//!
//! ## Thread Safety
//!
//! All transports are thread-safe and designed for concurrent access.
//! Uses `Arc<Mutex<>>` for channel receivers and `tokio` for async operations.
// Re-export the main types for convenience
pub use ;
pub use TransportConfig;
pub use ;
pub use TransportLayer;
// Re-export transport implementations for advanced usage
pub use MockTransport;
pub use QuicTransport;
pub use TcpTransport;