fields.rs |
|
6489 |
key.rs |
|
1015 |
mod.rs |
Transform Extensions provide information on content transformations in a given locale.
The main struct for this extension is [`Transform`] which contains [`Fields`] and an
optional [`LanguageIdentifier`].
[`LanguageIdentifier`]: super::super::LanguageIdentifier
# Examples
```
use icu::locid::extensions::transform::{Fields, Key, Transform, Value};
use icu::locid::{LanguageIdentifier, Locale};
let mut loc: Locale =
"en-US-t-es-ar-h0-hybrid".parse().expect("Parsing failed.");
let lang: LanguageIdentifier =
"es-AR".parse().expect("Parsing LanguageIdentifier failed.");
let key: Key = "h0".parse().expect("Parsing key failed.");
let value: Value = "hybrid".parse().expect("Parsing value failed.");
assert_eq!(loc.extensions.transform.lang, Some(lang));
assert!(loc.extensions.transform.fields.contains_key(&key));
assert_eq!(loc.extensions.transform.fields.get(&key), Some(&value));
assert_eq!(&loc.extensions.transform.to_string(), "t-es-ar-h0-hybrid");
``` |
8745 |
value.rs |
|
4016 |