Struct Uts46MapperBorrowed
struct Uts46MapperBorrowed<'a> { ... }
A borrowed version of a mapper that knows how to performs the subsets of UTS 46 processing documented on the methods.
Implementations
impl Uts46MapperBorrowed<'_>
fn map_normalize<'delegate, I: Iterator<Item = char> + 'delegate>(self: &'delegate Self, iter: I) -> impl Iterator<Item = char> + 'delegateReturns an iterator adaptor that turns an
Iteratorovercharinto an iterator yielding acharsequence that gets the following operations from the "Map" and "Normalize" steps of the "Processing" section of UTS 46 lazily applied to it:- The ignored characters are ignored.
- The mapped characters are mapped.
- The disallowed characters are replaced with U+FFFD, which itself is a disallowed character.
- The deviation characters are treated as mapped or valid as appropriate.
- The disallowed_STD3_valid characters are treated as allowed.
- The disallowed_STD3_mapped characters are treated as mapped.
- The result is normalized to NFC.
Notably:
- The STD3 or WHATWG ASCII deny list should be implemented as a post-processing step.
- Transitional processing is not performed. Transitional mapping would be a pre-processing step, but transitional processing is deprecated, and none of Firefox, Safari, or Chrome use it.
fn normalize_validate<'delegate, I: Iterator<Item = char> + 'delegate>(self: &'delegate Self, iter: I) -> impl Iterator<Item = char> + 'delegateReturns an iterator adaptor that turns an
Iteratorovercharinto an iterator yielding acharsequence that gets the following operations from the NFC check and statucs steps of the "Validity Criteria" section of UTS 46 lazily applied to it:- The ignored characters are treated as disallowed.
- The mapped characters are mapped.
- The disallowed characters are replaced with U+FFFD, which itself is a disallowed character.
- The deviation characters are treated as mapped or valid as appropriate.
- The disallowed_STD3_valid characters are treated as allowed.
- The disallowed_STD3_mapped characters are treated as mapped.
- The result is normalized to NFC.
Notably:
- The STD3 or WHATWG ASCII deny list should be implemented as a post-processing step.
- Transitional processing is not performed. Transitional mapping would be a pre-processing step, but transitional processing is deprecated, and none of Firefox, Safari, or Chrome use it.
- The output needs to be compared with input to see if anything changed. This check catches failures to adhere to the normalization and status requirements. In particular, this comparison results in mapped characters resulting in error like "Validity Criteria" requires.
impl Uts46MapperBorrowed<'static>
const fn static_to_owned(self: Self) -> Uts46MapperCheaply converts a [
Uts46MapperBorrowed<'static>] into aUts46Mapper.Note: Due to branching and indirection, using
Uts46Mappermight inhibit some compile-time optimizations that are possible withUts46MapperBorrowed.const fn new() -> SelfConstruct with compiled data.
impl Default for Uts46MapperBorrowed<'static>
fn default() -> Self
impl<'a> Debug for Uts46MapperBorrowed<'a>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<'a> Freeze for Uts46MapperBorrowed<'a>
impl<'a> RefUnwindSafe for Uts46MapperBorrowed<'a>
impl<'a> Send for Uts46MapperBorrowed<'a>
impl<'a> Sync for Uts46MapperBorrowed<'a>
impl<'a> Unpin for Uts46MapperBorrowed<'a>
impl<'a> UnsafeUnpin for Uts46MapperBorrowed<'a>
impl<'a> UnwindSafe for Uts46MapperBorrowed<'a>
impl<T> Any for Uts46MapperBorrowed<'a>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Uts46MapperBorrowed<'a>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Uts46MapperBorrowed<'a>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> ErasedDestructor for Uts46MapperBorrowed<'a>
impl<T> From for Uts46MapperBorrowed<'a>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for Uts46MapperBorrowed<'a>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Uts46MapperBorrowed<'a>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Uts46MapperBorrowed<'a>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>