[−][src]Struct pinyin::Pinyin
单个字符的拼音信息
Implementations
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
Auto Trait Implementations
impl RefUnwindSafe for Pinyin
impl Send for Pinyin
impl Sync for Pinyin
impl Unpin for Pinyin
impl UnwindSafe for Pinyin
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,