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
//! Transport layer implementations for the rate limiting server
//!
//! This module provides different network protocols for clients to communicate
//! with the rate limiter. All transports implement the [`Transport`] trait and
//! share the same underlying rate limiter state via the actor pattern.
//!
//! # Available Transports
//!
//! - [`http`]: REST API with JSON (easy integration)
//! - [`grpc`]: Protocol Buffers over HTTP/2 (service mesh friendly)
//! - [`redis`]: Redis protocol for native Redis client support
use crateRateLimiterHandle;
use Result;
use async_trait;
/// Common interface for all transport implementations
///
/// Each transport is responsible for:
/// - Accepting client connections
/// - Parsing protocol-specific requests
/// - Forwarding requests to the rate limiter actor
/// - Sending responses back to clients