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::enum_to_short_name_mapper();
assert_eq!(lookup.get(Script::Brahmi), Some(tinystr!(4, "Brah")));
assert_eq!(lookup.get(Script::Hangul), Some(tinystr!(4, "Hang")));
source§impl<T> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'static, T>where
T: TrieValue,
impl<T> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'static, T>where
T: TrieValue,
sourcepub const fn static_to_owned(
self,
) -> PropertyEnumToValueNameLinearTiny4Mapper<T>
pub const fn static_to_owned( self, ) -> PropertyEnumToValueNameLinearTiny4Mapper<T>
Cheaply converts a [PropertyEnumToValueNameLinearTiny4MapperBorrowed<'static>
] into a PropertyEnumToValueNameLinearTiny4Mapper
.
Note: Due to branching and indirection, using PropertyEnumToValueNameLinearTiny4Mapper
might inhibit some
compile-time optimizations that are possible with PropertyEnumToValueNameLinearTiny4MapperBorrowed
.
Trait Implementations§
source§impl<'a, T> Clone for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>where
T: Clone,
impl<'a, T> Clone for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>where
T: Clone,
source§fn clone(&self) -> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
fn clone(&self) -> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a, T> Debug for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>where
T: Debug,
impl<'a, T> Debug for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>where
T: Debug,
impl<'a, T> Copy for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>where
T: Copy,
Auto Trait Implementations§
impl<'a, T> Freeze for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
impl<'a, T> RefUnwindSafe for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
impl<'a, T> Send for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
impl<'a, T> Sync for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
impl<'a, T> Unpin for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
impl<'a, T> UnwindSafe for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, 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