Skip to main content

Hyw

Struct Hyw 

Source
pub struct Hyw { /* private fields */ }
Expand description

A combination of these characters.

Implementations§

Source§

impl Hyw

Source

pub const fn new() -> Self

Create a new Hyw.

Source

pub const fn from_index(index: usize) -> Option<Self>

Create a Hyw from combined index. If the index is out of bounds, return None.

Source

pub const fn to_index(&self) -> usize

Get the combined index of this Hyw.

Source

pub const fn next(&self) -> Option<Self>

Get the next Hyw combination. If it is the last combination, return None.

Source

pub const fn previous(&self) -> Option<Self>

Get the previous Hyw combination. If it is the first combination, return None.

Source

pub const fn iter_from(self) -> HywIterator

Returns an iterator over all Hyw combinations starting from this one

Source

pub const fn all() -> HywIterator

Returns an iterator over all possible Hyw combinations

Source

pub const fn set_he(&mut self, he: usize) -> bool

Set the indice of character with pinyin “he”. If the index is out of bounds, return false and do not modify the value.

Source

pub const fn set_yi(&mut self, yi: usize) -> bool

Set the indice of character with pinyin “yi”. If the index is out of bounds, return false and do not modify the value.

Source

pub const fn set_wei(&mut self, wei: usize) -> bool

Set the indice of character with pinyin “wei”. If the index is out of bounds, return false and do not modify the value.

Trait Implementations§

Source§

impl Clone for Hyw

Source§

fn clone(&self) -> Hyw

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Hyw

Source§

impl Debug for Hyw

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Hyw

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Hyw

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Hyw

Source§

impl FromStr for Hyw

Source§

type Err = ()

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl PartialEq for Hyw

Source§

fn eq(&self, other: &Hyw) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Hyw

Auto Trait Implementations§

§

impl Freeze for Hyw

§

impl RefUnwindSafe for Hyw

§

impl Send for Hyw

§

impl Sync for Hyw

§

impl Unpin for Hyw

§

impl UnsafeUnpin for Hyw

§

impl UnwindSafe for Hyw

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.