pub struct CanonicalDecomposition { /* private fields */ }
Expand description

The raw (non-recursive) canonical decomposition operation.

Callers should generally use DecomposingNormalizer instead of this API. However, this API is provided for callers such as HarfBuzz that specifically want access to non-recursive canonical decomposition e.g. for use in a glyph-availability-guided custom normalizer.

Implementations

Performs non-recursive canonical decomposition (including for Hangul).

    use icu_normalizer::properties::Decomposed;
    let decomp = icu_normalizer::properties::CanonicalDecomposition::try_new_unstable(&icu_testdata::unstable()).unwrap();

    assert_eq!(decomp.decompose('e'), Decomposed::Default);
    assert_eq!(
        decomp.decompose('ệ'),
        Decomposed::Expansion('ẹ', '\u{0302}')
    );
    assert_eq!(decomp.decompose('각'), Decomposed::Expansion('가', 'ᆨ'));
    assert_eq!(decomp.decompose('\u{212B}'), Decomposed::Singleton('Å')); // ANGSTROM SIGN
    assert_eq!(decomp.decompose('\u{2126}'), Decomposed::Singleton('Ω')); // OHM SIGN
    assert_eq!(decomp.decompose('\u{1F71}'), Decomposed::Singleton('ά')); // oxia

Construct from data provider.

📚 Help choosing a constructor

⚠️ The bounds on this function may change over time, including in SemVer minor releases.

Creates a new instance using an AnyProvider.

For details on the behavior of this function, see: Self::try_new_unstable

📚 Help choosing a constructor

Enabled with the "serde" feature.

Creates a new instance using a BufferProvider.

For details on the behavior of this function, see: Self::try_new_unstable

📚 Help choosing a constructor

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.