pub struct PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T> {
map: &'a PropertyEnumToValueNameLinearTiny4MapV1<'a>,
markers: PhantomData<fn(_: T)>,
}
Expand description
A borrowed wrapper around property value name-to-enum data, returned by
PropertyEnumToValueNameLinearTiny4Mapper::as_borrowed()
. More efficient to query.
Fields§
§map: &'a PropertyEnumToValueNameLinearTiny4MapV1<'a>
§markers: PhantomData<fn(_: T)>
Implementations§
source§impl<T: TrieValue> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'_, T>
impl<T: TrieValue> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'_, T>
sourcepub fn get(&self, property: T) -> Option<TinyStr4>
pub fn get(&self, property: T) -> Option<TinyStr4>
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: TrieValue> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'static, T>
impl<T: TrieValue> PropertyEnumToValueNameLinearTiny4MapperBorrowed<'static, T>
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> Clone for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
impl<'a, T: Clone> Clone for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
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> Debug for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
impl<'a, T: Debug> Debug for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
impl<'a, T: Copy> Copy for PropertyEnumToValueNameLinearTiny4MapperBorrowed<'a, T>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)