pub struct PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T> { /* private fields */ }
Expand description
A borrowed wrapper around property value name-to-enum data, returned by
PropertyEnumToValueNameLinearTiny4Mapper::as_borrowed()
. More efficient to query.
Implementations§
source§impl<T> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'_, T>where
T: TrieValue,
impl<T> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'_, T>where T: TrieValue,
sourcepub fn get(&self, property: T) -> Option<TinyAsciiStr<4>>
pub fn get(&self, property: T) -> Option<TinyAsciiStr<4>>
Get the property name given a value
Example
use icu::properties::Script;
use tinystr::tinystr;
let lookup =
Script::get_enum_to_short_name_mapper(&icu_testdata::unstable())
.expect("The data should be valid");
let lookup = lookup.as_borrowed();
assert_eq!(lookup.get(Script::Brahmi), Some(tinystr!(4, "Brah")));
assert_eq!(lookup.get(Script::Hangul), Some(tinystr!(4, "Hang")));