How hyperium/hyper works
Main Components
a. Client Component:
• HTTP/1 Connection Handler
• HTTP/2 Connection Handler
• Dispatch System
b. Server Component:
• HTTP/1 Connection Handler
• HTTP/2 Connection Handler
• Connection Management
c. Protocol Layer:
• H1 Protocol Implementation
• H2 Protocol Implementation
• Shared Protocol Traits
d. Body Management:
• "Body" component handling:
• Incoming Data
• Length Management
• Streaming Capabilities
e. Runtime & I/O:
• "RT" (Runtime) component managing:
• I/O Operations
• Timer Services
• Runtime Bounds
Component Relationships
• Client/Server → Protocol Layer (implementation dependency)
• Protocol Layer → Body Management (data flow)
• All Components → Runtime (runtime services usage)
• Service Layer → Client/Server (service implementation)
Data Flow
Primary data flows:
• External Client → Client Component → Protocol Layer → Body Management
• External Request → Server Component → Protocol Layer → Service Handler
Architectural Patterns
Following patterns:
• Asynchronous Design Pattern
• Protocol Abstraction Layer
• Connection Pooling
• Service Trait Implementation
Notes
Annotations for:
• Async Runtime Requirements
• HTTP/1 vs HTTP/2 Handling
• FFI Boundary Details
• Extension Points
This architecture should reflect Hyper's position as a foundational library that other HTTP clients and servers can build upon, showing clear integration points and extension mechanisms.