Skip to main content

kamu_iso3166/
lib.rs

1//! # `kamu-iso3166`
2//!
3//! Zero-allocation, `no_std`-compatible ISO 3166-1 and ISO 3166-2 primitives.
4//!
5//! ## Scope (v0.1)
6//!
7//! - ISO 3166-1: `Alpha2`, `Alpha3`, `Numeric` (see [`one`])
8//! - ISO 3166-2: subdivisions keyed by parent country (see [`two`])
9//!
10//! ## Features
11//!
12//! - `std` (default) — enables `std::error::Error` integrations.
13//! - `alloc` — reserved for future API surfaces that may accept owned strings.
14//! - `serde` — derive `Serialize`/`Deserialize` for all public types.
15//!
16//! All lookups return `&'static` data; no runtime allocation is performed.
17//!
18//! ## Licensing
19//!
20//! Crate code is licensed under Apache-2.0. The embedded ISO 3166 data is
21//! vendored from `ipregistry/iso3166` and is licensed under
22//! Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).
23//! See `NOTICE` and `VENDORED.md` for full attribution.
24
25#![cfg_attr(not(feature = "std"), no_std)]
26#![cfg_attr(docsrs, feature(doc_cfg))]
27#![deny(missing_docs)]
28#![forbid(unsafe_code)]
29
30pub mod error;
31pub mod one;
32pub mod two;
33
34#[cfg(feature = "serde")]
35mod serde_impl;
36
37pub use error::{ParseCountryError, ParseSubdivisionError};
38pub use one::{Alpha2, Alpha3, Numeric};
39pub use two::{Category, Subdivision};