Crate zip_codes_plus[][src]

Expand description

A lookup table for all primary U.S. ZIP codes.

Examples

assert_eq!(zip_codes_plus::map().get("10465").unwrap().state, "NY");
assert_eq!(zip_codes_plus::map().get("53186").unwrap().city, "Waukesha");
assert_eq!(
zip_codes_plus::by_city("Westwood, NJ").unwrap()
.iter()
.map(|r| r.zip_code)
.collect::<Vec<&str>>(),
vec!["07675"]
);
assert_eq!(
  zip_codes_plus::by_city("Whippany, NJ").unwrap()
    .iter()
    .map(|r| r.zip_code)
    .collect::<Vec<&str>>(),
  vec!["07983", "07999", "07981"]
);
assert!(
   zip_codes_plus::by_city("Nowhere, LA").is_none()
);

Structs

Enums

The classification of a ZIP code.

Functions

Returns a Vec<&Record> based on a “City, State”

Returns a reference to a static lookup table for all primary U.S. ZIP codes.

Type Definitions