pub struct Cf { /* private fields */ }
Expand description
In addition to the methods on the Request
struct, the Cf
struct on an inbound Request contains information about the request provided by Cloudflare’s edge.
Implementations§
source§impl Cf
impl Cf
sourcepub fn colo(&self) -> String
pub fn colo(&self) -> String
The three-letter airport code (e.g. ATX
, LUX
) representing
the colocation which processed the request
sourcepub fn as_organization(&self) -> String
pub fn as_organization(&self) -> String
The Autonomous System organization name of the request, e.g. Cloudflare, Inc.
sourcepub fn country(&self) -> Option<String>
pub fn country(&self) -> Option<String>
The two-letter country code of origin for the request.
This is the same value as that provided in the CF-IPCountry header, e.g. "US"
sourcepub fn http_protocol(&self) -> String
pub fn http_protocol(&self) -> String
The HTTP Protocol (e.g. “HTTP/2”) used by the request
sourcepub fn request_priority(&self) -> Option<RequestPriority>
pub fn request_priority(&self) -> Option<RequestPriority>
The browser-requested prioritization information in the request object,
See this blog post for details.
sourcepub fn tls_cipher(&self) -> String
pub fn tls_cipher(&self) -> String
The cipher for the connection to Cloudflare, e.g. “AEAD-AES128-GCM-SHA256”.
sourcepub fn tls_client_auth(&self) -> Option<TlsClientAuth>
pub fn tls_client_auth(&self) -> Option<TlsClientAuth>
Information about the client’s authorization. Only set when using Cloudflare Access or API Shield.
sourcepub fn tls_version(&self) -> String
pub fn tls_version(&self) -> String
The TLS version of the connection to Cloudflare, e.g. TLSv1.3.
sourcepub fn coordinates(&self) -> Option<(f32, f32)>
pub fn coordinates(&self) -> Option<(f32, f32)>
Latitude and longitude of the incoming request, e.g. (30.27130, -97.74260)
sourcepub fn postal_code(&self) -> Option<String>
pub fn postal_code(&self) -> Option<String>
Postal code of the incoming request, e.g. “78701”
sourcepub fn metro_code(&self) -> Option<String>
pub fn metro_code(&self) -> Option<String>
Metro code (DMA) of the incoming request, e.g. “635”
sourcepub fn region(&self) -> Option<String>
pub fn region(&self) -> Option<String>
If known, the ISO 3166-2 name for the first level region associated with the IP address of the incoming request, e.g. “Texas”.
sourcepub fn region_code(&self) -> Option<String>
pub fn region_code(&self) -> Option<String>
If known, the ISO 3166-2 code for the first level region associated with the IP address of the incoming request, e.g. “TX”.
sourcepub fn timezone(&self) -> Result<impl TimeZone>
pub fn timezone(&self) -> Result<impl TimeZone>
Requires timezone
feature. Timezone of the incoming request
sourcepub fn timezone_name(&self) -> String
pub fn timezone_name(&self) -> String
Timezone name of the incoming request
sourcepub fn is_eu_country(&self) -> bool
pub fn is_eu_country(&self) -> bool
Whether the country of the incoming request is in the EU