Registry / utility / country-code

country-code

JSON →
library0.4.0rscratesunverified

A Rust library for working with country codes, providing ISO 3166-1 alpha-2 and alpha-3 codes.

# Cargo.toml [dependencies] country-code = "0.4.0"
INSTALL
IMPORT
SIG · COUNTRY-CODE
C
country-code
utilityrustv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CountryCode
use country_code::CountryCode;

Look up a country by its alpha-2 code and print its name and alpha-3 code.

use country_code::CountryCode; fn main() { let us = CountryCode::from_alpha2("US").unwrap(); println!("Country: {}, Alpha3: {}", us.name(), us.alpha3()); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.4.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
country-code — cargo add country-code · libregistry