pub struct PropertyEnumToValueNameSparseMapperBorrowed<'a, T> { /* private fields */ }
Expand description
A borrowed wrapper around property value name-to-enum data, returned by
PropertyEnumToValueNameSparseMapper::as_borrowed()
. More efficient to query.
Implementations§
source§impl<T> PropertyEnumToValueNameSparseMapperBorrowed<'_, T>where
T: TrieValue,
impl<T> PropertyEnumToValueNameSparseMapperBorrowed<'_, T>where T: TrieValue,
sourcepub fn get(&self, property: T) -> Option<&str>
pub fn get(&self, property: T) -> Option<&str>
Get the property name given a value
Example
use icu::properties::CanonicalCombiningClass;
let lookup = CanonicalCombiningClass::get_enum_to_long_name_mapper(
&icu_testdata::unstable(),
)
.expect("The data should be valid");
let lookup = lookup.as_borrowed();
assert_eq!(
lookup.get(CanonicalCombiningClass::KanaVoicing),
Some("Kana_Voicing")
);
assert_eq!(
lookup.get(CanonicalCombiningClass::AboveLeft),
Some("Above_Left")
);