Module rustpostal::expand[][src]

Expand description

Normalization utilities.

Examples

use rustpostal::{expand, LibModules};
use rustpostal::error::RuntimeError;

fn main() -> Result<(), RuntimeError> {
    let postal_module = LibModules::Expand;
    postal_module.setup()?;

    let address = "St Johns Centre, Rope Walk, Bedford, Bedfordshire, MK42 0XE, United Kingdom";

    let languages = ["en", "gb"];
    let expanded = expand::expand_address_with_options(address, Some(languages.iter()))?;

    for variation in &expanded {
        println!("{}", variation);
    }

    Ok(())
}

Structs

Bit set of active address components in normalization options.

Normalization options.

Collections of normalized variations of postal address.

Bit set of active string options.

Functions

Normalize address with default options.

Normalize address with optional user-defined languages.