Struct icu_properties::EmojiSetData
source · pub struct EmojiSetData { /* private fields */ }
Expand description
A wrapper around UnicodeSet
data (characters and strings)
Implementations§
source§impl EmojiSetData
impl EmojiSetData
sourcepub const fn new<P: EmojiSet>() -> EmojiSetDataBorrowed<'static>
pub const fn new<P: EmojiSet>() -> EmojiSetDataBorrowed<'static>
Creates a new EmojiSetData
for a EmojiSet
.
See the documentation on EmojiSet
implementations for details.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_unstable<P: EmojiSet>(
provider: &(impl DataProvider<P::DataMarker> + ?Sized),
) -> Result<EmojiSetData, DataError>
pub fn try_new_unstable<P: EmojiSet>( provider: &(impl DataProvider<P::DataMarker> + ?Sized), ) -> Result<EmojiSetData, DataError>
A version of new()
that uses custom data provided by a [DataProvider
].
Note that this will return an owned version of the data. Functionality is available on
the borrowed version, accessible through EmojiSetData::as_borrowed
.
sourcepub fn as_borrowed(&self) -> EmojiSetDataBorrowed<'_>
pub fn as_borrowed(&self) -> EmojiSetDataBorrowed<'_>
Construct a borrowed version of this type that can be queried.
This avoids a potential small underlying cost per API call (ex: contains()
) by consolidating it
up front.
sourcepub fn from_code_point_inversion_list_string_list(
set: CodePointInversionListAndStringList<'static>,
) -> Self
pub fn from_code_point_inversion_list_string_list( set: CodePointInversionListAndStringList<'static>, ) -> Self
Construct a new owned [CodePointInversionListAndStringList
]
sourcepub fn as_code_point_inversion_list_string_list(
&self,
) -> Option<&CodePointInversionListAndStringList<'_>>
pub fn as_code_point_inversion_list_string_list( &self, ) -> Option<&CodePointInversionListAndStringList<'_>>
Convert this type to a [CodePointInversionListAndStringList
] as a borrowed value.
The data backing this is extensible and supports multiple implementations.
Currently it is always [CodePointInversionListAndStringList
]; however in the future more backends may be
added, and users may select which at data generation time.
This method returns an Option
in order to return None
when the backing data provider
cannot return a [CodePointInversionListAndStringList
], or cannot do so within the expected constant time
constraint.
sourcepub fn to_code_point_inversion_list_string_list(
&self,
) -> CodePointInversionListAndStringList<'_>
pub fn to_code_point_inversion_list_string_list( &self, ) -> CodePointInversionListAndStringList<'_>
Convert this type to a [CodePointInversionListAndStringList
], borrowing if possible,
otherwise allocating a new [CodePointInversionListAndStringList
].
The data backing this is extensible and supports multiple implementations.
Currently it is always [CodePointInversionListAndStringList
]; however in the future more backends may be
added, and users may select which at data generation time.
The performance of the conversion to this specific return type will vary
depending on the data structure that is backing self
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EmojiSetData
impl RefUnwindSafe for EmojiSetData
impl Send for EmojiSetData
impl Sync for EmojiSetData
impl Unpin for EmojiSetData
impl UnwindSafe for EmojiSetData
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
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>
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>
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