pub struct ComposingNormalizerBorrowed<'a> { /* private fields */ }
Expand description
Borrowed version of a normalizer for performing composing normalization.
Implementations§
Source§impl ComposingNormalizerBorrowed<'static>
impl ComposingNormalizerBorrowed<'static>
Sourcepub const fn static_to_owned(self) -> ComposingNormalizer
pub const fn static_to_owned(self) -> ComposingNormalizer
Cheaply converts a [ComposingNormalizerBorrowed<'static>
] into a ComposingNormalizer
.
Note: Due to branching and indirection, using ComposingNormalizer
might inhibit some
compile-time optimizations that are possible with ComposingNormalizerBorrowed
.
Sourcepub const fn new_nfc() -> Self
pub const fn new_nfc() -> Self
NFC constructor using compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Source§impl<'data> ComposingNormalizerBorrowed<'data>
impl<'data> ComposingNormalizerBorrowed<'data>
Sourcepub fn normalize_iter<I: Iterator<Item = char>>(
&self,
iter: I,
) -> Composition<'data, I> ⓘ
pub fn normalize_iter<I: Iterator<Item = char>>( &self, iter: I, ) -> Composition<'data, I> ⓘ
Wraps a delegate iterator into a composing iterator adapter by using the data already held by this normalizer.
Sourcepub fn normalize<'a>(&self, text: &'a str) -> Cow<'a, str>
pub fn normalize<'a>(&self, text: &'a str) -> Cow<'a, str>
Normalize a string slice into a Cow<'a, str>
.
Sourcepub fn split_normalized<'a>(&self, text: &'a str) -> (&'a str, &'a str)
pub fn split_normalized<'a>(&self, text: &'a str) -> (&'a str, &'a str)
Split a string slice into maximum normalized prefix and unnormalized suffix such that the concatenation of the prefix and the normalization of the suffix is the normalization of the whole input.
Sourcepub fn is_normalized(&self, text: &str) -> bool
pub fn is_normalized(&self, text: &str) -> bool
Check whether a string slice is normalized.