[][src]Trait pinyin::ToPinyin

pub trait ToPinyin {
    type Output;
    fn to_pinyin(&self) -> Self::Output;
}

用于获取拼音信息的trait

Associated Types

type Output

Loading content...

Required methods

fn to_pinyin(&self) -> Self::Output

Loading content...

Implementations on Foreign Types

impl ToPinyin for char[src]

use pinyin::ToPinyin;
assert_eq!('拼'.to_pinyin().unwrap().plain(), "pin");

impl<'a> ToPinyin for &'a str[src]

use pinyin::{ToPinyin, Pinyin};
let mut iter = "拼音".to_pinyin();
let mut next_plain = || iter.next().and_then(|p| p).map(Pinyin::plain);
assert_eq!(next_plain(), Some("pin"));
assert_eq!(next_plain(), Some("yin"));
assert_eq!(next_plain(), None);

type Output = PinyinStrIter<'a>

Loading content...

Implementors

Loading content...