pub struct AppState {Show 14 fields
pub snapshot: ArcSwap<Snapshot>,
pub clients: ProxyClients,
pub retry: RetryPolicy,
pub body_limit: usize,
pub body_read_idle: Duration,
pub inbound_body_timeout: Duration,
pub permit_queue_timeout: Duration,
pub body_total_budget: Duration,
pub forward_total_budget: Duration,
pub reload: Arc<ReloadStatus>,
pub counters: Arc<ServeCounters>,
pub inbound_permits: Arc<Semaphore>,
pub audit: Audit,
pub started: Instant,
}Fields§
§snapshot: ArcSwap<Snapshot>§clients: ProxyClients§retry: RetryPolicy§body_limit: usize§body_read_idle: DurationPer-chunk read-idle bound for non-streaming upstream bodies (BODY_READ_IDLE in production; tests inject a small value).
inbound_body_timeout: DurationWhole-body bound on reading the inbound request body (CLIENT_BODY_TIMEOUT in production; tests inject a small value).
permit_queue_timeout: DurationBound on queueing for an inbound permit (PERMIT_QUEUE_TIMEOUT in production; tests inject a small value).
body_total_budget: DurationWhole-body budget for a non-streaming upstream response (BODY_TOTAL_BUDGET in production; tests inject a small value).
forward_total_budget: DurationWhole-forward budget: all retry attempts, backoffs and retryable-body drains combined (FORWARD_TOTAL_BUDGET in production; tests inject a small value). Bounds how long one request can hold an inbound permit.
reload: Arc<ReloadStatus>Hot-reload health, published for the health endpoint and the watcher watchdog.
counters: Arc<ServeCounters>Serve-loop counters (shed connections, per-connection accept errors), published on the health endpoint.
inbound_permits: Arc<Semaphore>Bounds concurrent handler executions — the memory-heavy phase (whole inbound body buffered + waiting for upstream response headers). The permit is held until the handler returns; the response body, including long-lived SSE, streams afterwards without one, so streams can never starve new requests. The health endpoint is not routed through the handler and stays available under load.
audit: Audit§started: Instant