[][src]Struct pinyin::Pinyin

pub struct Pinyin(_);

单个字符的拼音信息

Methods

impl Pinyin[src]

pub fn plain(self) -> &'static str[src]

普通风格,不带声调

仅在启用 plain 特性时可用

assert_eq!(to_pinyin_vec("拼音", Pinyin::plain), vec!["pin", "yin"]);

pub fn with_tone(self) -> &'static str[src]

带声调的风格

仅在启用 with_tone 特性时可用

assert_eq!(to_pinyin_vec("拼音", Pinyin::with_tone), vec!["pīn", "yīn"]);

pub fn with_tone_num(self) -> &'static str[src]

声调在各个拼音之后,使用数字1-4表示的风格

仅在启用 with_tone_num 特性时可用

assert_eq!(to_pinyin_vec("拼音", Pinyin::with_tone_num), vec!["pi1n", "yi1n"]);

pub fn with_tone_num_end(self) -> &'static str[src]

声调在拼音最后,使用数字1-4表示的风格

仅在启用 with_tone_num_end 特性时可用

assert_eq!(to_pinyin_vec("拼音", Pinyin::with_tone_num_end), vec!["pin1", "yin1"]);

pub fn first_letter(self) -> &'static str[src]

首字母风格

仅在启用 plain 特性时可用

assert_eq!(to_pinyin_vec("拼音", Pinyin::first_letter), vec!["p", "y"]);
assert_eq!(to_pinyin_vec("中国", Pinyin::first_letter), vec!["z", "g"]);
assert_eq!(to_pinyin_vec("安心", Pinyin::first_letter), vec!["a", "x"]);

Trait Implementations

impl Copy for Pinyin[src]

impl Clone for Pinyin[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Pinyin

impl Sync for Pinyin

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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