pub struct PropertyNamesLong<T: NamedEnumeratedProperty> { /* private fields */ }
Expand description
A struct capable of looking up a property name from a value
Access its data by calling Self::as_borrowed()
and using the methods on
PropertyNamesLongBorrowed
.
§Example
use icu::properties::props::CanonicalCombiningClass;
use icu::properties::PropertyNamesLong;
let names = PropertyNamesLong::<CanonicalCombiningClass>::new();
assert_eq!(
names.get(CanonicalCombiningClass::KanaVoicing),
Some("Kana_Voicing")
);
assert_eq!(
names.get(CanonicalCombiningClass::AboveLeft),
Some("Above_Left")
);
Implementations§
Source§impl<T: NamedEnumeratedProperty> PropertyNamesLong<T>
impl<T: NamedEnumeratedProperty> PropertyNamesLong<T>
Sourcepub fn new() -> PropertyNamesLongBorrowed<'static, T>
pub fn new() -> PropertyNamesLongBorrowed<'static, T>
Creates a new instance of PropertyNamesLongBorrowed<T>
.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_unstable(
provider: &(impl DataProvider<T::DataMarkerLong> + ?Sized),
) -> Result<Self, DataError>
pub fn try_new_unstable( provider: &(impl DataProvider<T::DataMarkerLong> + ?Sized), ) -> Result<Self, DataError>
A version of Self::new
that uses custom data provided by a DataProvider
.
⚠️ The bounds on provider may change over time, including in SemVer minor releases.
Sourcepub fn as_borrowed(&self) -> PropertyNamesLongBorrowed<'_, T>
pub fn as_borrowed(&self) -> PropertyNamesLongBorrowed<'_, T>
Construct a borrowed version of this type that can be queried.
This avoids a potential small underlying cost per API call (like get_static()
) by consolidating it
up front.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for PropertyNamesLong<T>
impl<T> RefUnwindSafe for PropertyNamesLong<T>
impl<T> Send for PropertyNamesLong<T>
impl<T> Sync for PropertyNamesLong<T>
impl<T> Unpin for PropertyNamesLong<T>
impl<T> UnwindSafe for PropertyNamesLong<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more