Struct icu::properties::PropertyNamesShort
source · pub struct PropertyNamesShort<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
PropertyNamesShortBorrowed
.
§Example
use icu::properties::PropertyNamesShort;
use icu::properties::props::CanonicalCombiningClass;
let names = PropertyNamesShort::<CanonicalCombiningClass>::new();
assert_eq!(
names.get(CanonicalCombiningClass::KanaVoicing),
Some("KV")
);
assert_eq!(
names.get(CanonicalCombiningClass::AboveLeft),
Some("AL")
);
Implementations§
source§impl<T> PropertyNamesShort<T>where
T: NamedEnumeratedProperty,
impl<T> PropertyNamesShort<T>where
T: NamedEnumeratedProperty,
sourcepub fn new() -> PropertyNamesShortBorrowed<'static, T>
pub fn new() -> PropertyNamesShortBorrowed<'static, T>
Creates a new instance of PropertyNamesShortBorrowed<T>
.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_unstable(
provider: &(impl DataProvider<<T as NamedEnumeratedProperty>::DataMarkerShort> + ?Sized),
) -> Result<PropertyNamesShort<T>, DataError>
pub fn try_new_unstable( provider: &(impl DataProvider<<T as NamedEnumeratedProperty>::DataMarkerShort> + ?Sized), ) -> Result<PropertyNamesShort<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) -> PropertyNamesShortBorrowed<'_, T>
pub fn as_borrowed(&self) -> PropertyNamesShortBorrowed<'_, 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 PropertyNamesShort<T>
impl<T> RefUnwindSafe for PropertyNamesShort<T>
impl<T> Send for PropertyNamesShort<T>
impl<T> Sync for PropertyNamesShort<T>
impl<T> Unpin for PropertyNamesShort<T>
impl<T> UnwindSafe for PropertyNamesShort<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