Struct worker_plus::Cf

source ·
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.

Details

Implementations§

The three-letter airport code (e.g. ATX, LUX) representing the colocation which processed the request

The Autonomous System Number (ASN) of the request, e.g. 395747

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"

The HTTP Protocol (e.g. “HTTP/2”) used by the request

The browser-requested prioritization information in the request object,

See this blog post for details.

The cipher for the connection to Cloudflare, e.g. “AEAD-AES128-GCM-SHA256”.

Information about the client’s authorization. Only set when using Cloudflare Access or API Shield.

The TLS version of the connection to Cloudflare, e.g. TLSv1.3.

City of the incoming request, e.g. “Austin”.

Continent of the incoming request, e.g. “NA”

Latitude and longitude of the incoming request, e.g. (30.27130, -97.74260)

Postal code of the incoming request, e.g. “78701”

Metro code (DMA) of the incoming request, e.g. “635”

If known, the ISO 3166-2 name for the first level region associated with the IP address of the incoming request, e.g. “Texas”.

If known, the ISO 3166-2 code for the first level region associated with the IP address of the incoming request, e.g. “TX”.

Timezone of the incoming request

Whether the country of the incoming request is in the EU

Trait Implementations§

Formats the value using the given formatter. Read more
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.