use-address 0.1.0

Primitive address component vocabulary for RustUse
Documentation
  • Coverage
  • 8.33%
    13 out of 156 items documented1 out of 67 items with examples
  • Size
  • Source code size: 26.77 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.96 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-geography
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-address

Primitive address component vocabulary for RustUse.

use-address provides small descriptive primitives for address lines, street parts, localities, administrative areas, postal codes, country codes, and lightweight address metadata.

It models address components. It does not parse free-form addresses, geocode, reverse geocode, validate against postal services, format via CLDR, calculate shipping, look up maps, or resolve coordinates.

Relationship to use-locale

use-address models address components and address-oriented metadata. use-locale models locale identifiers and formatting context. use-address may carry lightweight formatting hints, but it does not implement locale-aware address formatting in v0.1.

Non-goals

  • address parsing
  • geocoding
  • reverse geocoding
  • postal-service validation
  • shipping-rate lookup
  • CLDR formatting
  • map lookup
  • coordinate resolution

Example

use use_address::{Address, AddressCountryCode, AddressLine, Locality};

# fn main() -> Result<(), Box<dyn std::error::Error>> {
let address = Address::new()
    .with_line(AddressLine::new("123 Main St")?);

let address = Address {
    locality: Some(Locality::new("Fort Wayne")?),
    country_code: Some(AddressCountryCode::new("us")?),
    ..address
};

assert!(!address.is_empty());
assert!(address.has_country());
# Ok(())
# }