Struct icu::properties::PropertyNamesLong
source · pub struct PropertyNamesLong<T>where
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::PropertyNamesLong;
use icu::properties::props::CanonicalCombiningClass;
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> PropertyNamesLong<T>where
T: NamedEnumeratedProperty,
impl<T> PropertyNamesLong<T>where
T: NamedEnumeratedProperty,
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 as NamedEnumeratedProperty>::DataMarkerLong> + ?Sized),
) -> Result<PropertyNamesLong<T>, DataError>
pub fn try_new_unstable( provider: &(impl DataProvider<<T as NamedEnumeratedProperty>::DataMarkerLong> + ?Sized), ) -> Result<PropertyNamesLong<T>, 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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more