Skip to main content

CanonicalCompositionsRef

Enum CanonicalCompositionsRef 

Source
pub(crate) enum CanonicalCompositionsRef<'data> {
    Current(&'data FastCodePointTrie<'data, u16>, &'data ZeroSlice<(u16, u16)>, &'data ZeroSlice<(char, char)>),
}

Variants§

§

Current(&'data FastCodePointTrie<'data, u16>, &'data ZeroSlice<(u16, u16)>, &'data ZeroSlice<(char, char)>)

Implementations§

Source§

impl<'data> CanonicalCompositionsRef<'data>

Source

pub(crate) fn compose(&self, starter: char, second: char) -> Option<char>

Performs canonical composition (including Hangul) on a pair of characters or returns None if these characters don’t compose. Composition exclusions are taken into account.

TODO: Have the caller retain more state and have this function return more information that is useful for retaining information between attempts to compose in a sequence of such attempts:

  • We can return the linear search slice when we search through it but don’t find anything.
  • We can know that no further matches are possible.
  • We can know that the starter was a special ASCII vowel.
  • We can know that we just formed a Hangul LV syllable.
Source

pub(crate) fn compose_starter( &self, starter: char, second: char, starter_is_lv: bool, ) -> Option<(char, bool)>

Performs canonical composition (including Hangul) on a pair of characters on the assumption that the second one is a starter or returns None if these characters don’t compose. Composition exclusions are taken into account.

The returned boolean can be true only if char a Hangul LV syllable.

The argument starter_is_lv must be set either to false or to the value that this method previously returned alongside starter.

Trait Implementations§

Source§

impl<'data> Debug for CanonicalCompositionsRef<'data>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'data> Freeze for CanonicalCompositionsRef<'data>

§

impl<'data> RefUnwindSafe for CanonicalCompositionsRef<'data>

§

impl<'data> Send for CanonicalCompositionsRef<'data>

§

impl<'data> Sync for CanonicalCompositionsRef<'data>

§

impl<'data> Unpin for CanonicalCompositionsRef<'data>

§

impl<'data> UnsafeUnpin for CanonicalCompositionsRef<'data>

§

impl<'data> UnwindSafe for CanonicalCompositionsRef<'data>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,