icu_locid::extensions

Module private

Source
Expand description

Private Use Extensions is a list of extensions intended for private use.

Those extensions are treated as a pass-through, and no Unicode related behavior depends on them.

The main struct for this extension is Private which is a list of Subtags.

§Examples

use icu::locid::extensions::private::subtag;
use icu::locid::{locale, Locale};

let mut loc: Locale = "en-US-x-foo-faa".parse().expect("Parsing failed.");

assert!(loc.extensions.private.contains(&subtag!("foo")));
assert_eq!(loc.extensions.private.iter().next(), Some(&subtag!("foo")));

loc.extensions.private.clear();

assert!(loc.extensions.private.is_empty());
assert_eq!(loc, locale!("en-US"));

Macros§

  • A macro allowing for compile-time construction of valid Subtag subtags.

Structs§