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> + 'delegate

Returns an iterator adaptor that turns an Iterator over char into an iterator yielding a char sequence that gets the following operations from the "Map" and "Normalize" steps of the "Processing" section of UTS 46 lazily applied to it:

  1. The ignored characters are ignored.
  2. The mapped characters are mapped.
  3. The disallowed characters are replaced with U+FFFD, which itself is a disallowed character.
  4. The deviation characters are treated as mapped or valid as appropriate.
  5. The disallowed_STD3_valid characters are treated as allowed.
  6. The disallowed_STD3_mapped characters are treated as mapped.
  7. 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> + 'delegate

Returns an iterator adaptor that turns an Iterator over char into an iterator yielding a char sequence that gets the following operations from the NFC check and statucs steps of the "Validity Criteria" section of UTS 46 lazily applied to it:

  1. The ignored characters are treated as disallowed.
  2. The mapped characters are mapped.
  3. The disallowed characters are replaced with U+FFFD, which itself is a disallowed character.
  4. The deviation characters are treated as mapped or valid as appropriate.
  5. The disallowed_STD3_valid characters are treated as allowed.
  6. The disallowed_STD3_mapped characters are treated as mapped.
  7. 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) -> Uts46Mapper

Cheaply converts a [Uts46MapperBorrowed<'static>] into a Uts46Mapper.

Note: Due to branching and indirection, using Uts46Mapper might inhibit some compile-time optimizations that are possible with Uts46MapperBorrowed.

const fn new() -> Self

Construct 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) -> T

Returns the argument unchanged.

impl<T, U> Into for Uts46MapperBorrowed<'a>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses 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>