Struct PropertyNamesLongBorrowed

struct PropertyNamesLongBorrowed<'a, T: NamedEnumeratedProperty> { ... }

A borrowed wrapper around property value name-to-enum data, returned by [PropertyNamesLong::as_borrowed()]. More efficient to query.

Implementations

impl<'a, T: NamedEnumeratedProperty> PropertyNamesLongBorrowed<'a, T>

fn get(self: Self, property: T) -> Option<&'a str>

Get the property name given a value

Example

use icu::properties::props::CanonicalCombiningClass;
use icu::properties::PropertyNamesLong;

let lookup = PropertyNamesLong::<CanonicalCombiningClass>::new();
assert_eq!(
    lookup.get(CanonicalCombiningClass::KanaVoicing),
    Some("Kana_Voicing")
);
assert_eq!(
    lookup.get(CanonicalCombiningClass::AboveLeft),
    Some("Above_Left")
);

impl<T: NamedEnumeratedProperty> PropertyNamesLongBorrowed<'static, T>

fn new() -> Self

Creates a new instance of PropertyNamesLongBorrowed<T>.

Enabled with the compiled_data Cargo feature.

📚 Help choosing a constructor

fn static_to_owned(self: Self) -> PropertyNamesLong<T>

Cheaply converts a [PropertyNamesLongBorrowed<'static>] into a PropertyNamesLong.

Note: Due to branching and indirection, using PropertyNamesLong might inhibit some compile-time optimizations that are possible with PropertyNamesLongBorrowed.

This is currently not const unlike other static_to_owned() functions since it needs const traits to do that safely

impl<'a, T> Freeze for PropertyNamesLongBorrowed<'a, T>

impl<'a, T> RefUnwindSafe for PropertyNamesLongBorrowed<'a, T>

impl<'a, T> Send for PropertyNamesLongBorrowed<'a, T>

impl<'a, T> Sync for PropertyNamesLongBorrowed<'a, T>

impl<'a, T> Unpin for PropertyNamesLongBorrowed<'a, T>

impl<'a, T> UnsafeUnpin for PropertyNamesLongBorrowed<'a, T>

impl<'a, T> UnwindSafe for PropertyNamesLongBorrowed<'a, T>

impl<'a, T: $crate::fmt::Debug + NamedEnumeratedProperty> Debug for PropertyNamesLongBorrowed<'a, T>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<T> Any for PropertyNamesLongBorrowed<'a, T>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for PropertyNamesLongBorrowed<'a, T>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for PropertyNamesLongBorrowed<'a, T>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for PropertyNamesLongBorrowed<'a, T>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> ErasedDestructor for PropertyNamesLongBorrowed<'a, T>

impl<T> From for PropertyNamesLongBorrowed<'a, T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for PropertyNamesLongBorrowed<'a, T>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for PropertyNamesLongBorrowed<'a, T>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for PropertyNamesLongBorrowed<'a, T>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for PropertyNamesLongBorrowed<'a, T>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<T: NamedEnumeratedProperty> Clone for PropertyNamesLongBorrowed<'_, T>

fn clone(self: &Self) -> Self

impl<T: NamedEnumeratedProperty> Copy for PropertyNamesLongBorrowed<'_, T>

impl<T: NamedEnumeratedProperty> Default for PropertyNamesLongBorrowed<'static, T>

fn default() -> Self