| Crates.io | cf-colo-hint |
| lib.rs | cf-colo-hint |
| version | 0.1.332 |
| created_at | 2025-12-15 23:25:46.060445+00 |
| updated_at | 2026-01-26 00:38:25.873508+00 |
| description | Cloudflare colo to Durable Objects location hint mapping |
| homepage | |
| repository | https://github.com/connyay/cf-colo-hint |
| max_upload_size | |
| id | 1986957 |
| size | 458,071 |
A Rust library that maps Cloudflare edge locations (colos) to Durable Objects location hints.
use cf_colo_hint::{Colo, LocationHint};
// Parse a colo from the cf-ray header or request metadata
let colo = Colo::from_code("LAX").expect("unknown colo");
// Get the recommended location hint for Durable Objects
if let Some(hint) = colo.location_hint() {
println!("Use location hint: {}", hint.as_str());
}
// Work with location hints directly
let hint = LocationHint::WNam;
assert_eq!(hint.as_str(), "wnam");
assert_eq!(hint.name(), "Western North America");
no_std compatibleColo data is sourced from:
Run the refresh script to pull the latest data and regenerate the Rust code:
./refresh.sh
MIT