Macro icu_locid::transform_ext_key
source · [−]macro_rules! transform_ext_key {
($key:literal) => { ... };
}
Expand description
A macro allowing for compile-time construction of valid Transform Key
subtag.
The macro will perform syntax canonicalization of the tag.
Examples
use icu::locid::transform_ext_key;
use icu::locid::extensions::transform::{Key, Value};
use icu::locid::Locale;
use writeable::Writeable;
const HYBRID_KEY: Key = transform_ext_key!("h0");
let loc: Locale = "hi-t-en-h0-hybrid".parse().unwrap();
assert_eq!(
loc.extensions.transform.fields.get(&HYBRID_KEY),
Some(&Value::from_bytes(b"hybrid").unwrap())
);