[]Enum gokien::tone::Tone

pub enum Tone {
    None,
    Grave,
    Acute,
    HookAbove,
    Tilde,
    DotBelow,
}

Tone (thanh điệu), which also called "accent", lists all possible tones in Vietnamese.

These tones are:

Tone Example
None a
Grave à
Acute á
Hook above
Tilde ã
Dot below

Variants

Methods

impl Tone

Get tone from a char ch.

In case of ch is non-toned, Tone::None is returned.

Example

assert_eq!(Tone::get_tone('á'), Tone::Acute);Run

Add a tone tone to char ch.

In case of ch is non-toned, the original ch is returned.

Example

assert_eq!(Tone::add_tone('á', Tone::Tilde), 'ã');Run

Clear the tone in ch. Return the result and the old tone.

In case of non-toned ch, the original ch is returned with Tone::None.

Example

assert_eq!(Tone::clear_tone('á'), ('a', Tone::Acute));Run

Trait Implementations

impl PartialEq<Tone> for Tone

This method tests for !=.

impl From<u8> for Tone

impl Debug for Tone

Auto Trait Implementations

impl Send for Tone

impl Sync for Tone

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]