cf-gears-toolkit 0.16.0

Core ToolKit library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! The caller's address as the edge resolved it.

use std::net::IpAddr;

/// Request extension carrying the client address the API gateway resolved
/// from the connection (and, behind trusted proxies, from their forwarding
/// headers).
///
/// Only the gateway inserts it; handlers read it instead of parsing
/// `X-Forwarded-For` / `X-Real-IP`, which the client controls. A request that
/// did not come through the gateway (an in-process client call) has none.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct ClientIp(pub IpAddr);