icu_properties::sets

Function load_for_ecma262

Source
pub fn load_for_ecma262(
    name: &str,
) -> Result<CodePointSetDataBorrowed<'static>, PropertiesError>
Expand description

Returns a type capable of looking up values for a property specified as a string, as long as it is a binary property listed in ECMA-262, using strict matching on the names in the spec.

This handles every property required by ECMA-262 /u regular expressions, except for:

Enabled with the compiled_data Cargo feature.

📚 Help choosing a constructor

use icu::properties::sets;

let emoji = sets::load_for_ecma262("Emoji").expect("loading data failed");

assert!(emoji.contains('🔥')); // U+1F525 FIRE
assert!(!emoji.contains('V'));