Struct chinese_numerals::LongScaleInt
source · [−]pub struct LongScaleInt { /* private fields */ }
Expand description
Long scale integers (上数).
「上数者,数穷则变。若言万万曰亿,亿亿曰兆、兆兆曰京也。」
Implementations
sourceimpl LongScaleInt
impl LongScaleInt
sourcepub fn new_non_pos(abs: u128) -> Self
pub fn new_non_pos(abs: u128) -> Self
Generates a new non-positive long scale integer from given absolute value.
There is no way to generate Chinese numerals by From
trait from negative primitive numbers less than i128::MIN
. This associated function provides a way to generate them from the given absolute value less than or equal to u128::MAX
. This crate also provides struct LongScaleBigInt
for integers with absolute value larger than u128::MAX
.
Trait Implementations
sourceimpl Clone for LongScaleInt
impl Clone for LongScaleInt
sourcefn clone(&self) -> LongScaleInt
fn clone(&self) -> LongScaleInt
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LongScaleInt
impl Debug for LongScaleInt
sourceimpl Default for LongScaleInt
impl Default for LongScaleInt
sourcefn default() -> LongScaleInt
fn default() -> LongScaleInt
Returns the “default value” for a type. Read more
sourceimpl Display for LongScaleInt
impl Display for LongScaleInt
sourceimpl Ord for LongScaleInt
impl Ord for LongScaleInt
sourceimpl PartialEq<LongScaleInt> for LongScaleInt
impl PartialEq<LongScaleInt> for LongScaleInt
sourcefn eq(&self, other: &LongScaleInt) -> bool
fn eq(&self, other: &LongScaleInt) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &LongScaleInt) -> bool
fn ne(&self, other: &LongScaleInt) -> bool
This method tests for !=
.
sourceimpl PartialOrd<LongScaleInt> for LongScaleInt
impl PartialOrd<LongScaleInt> for LongScaleInt
sourcefn partial_cmp(&self, other: &LongScaleInt) -> Option<Ordering>
fn partial_cmp(&self, other: &LongScaleInt) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for LongScaleInt
impl Eq for LongScaleInt
impl StructuralEq for LongScaleInt
impl StructuralPartialEq for LongScaleInt
Auto Trait Implementations
impl RefUnwindSafe for LongScaleInt
impl Send for LongScaleInt
impl Sync for LongScaleInt
impl Unpin for LongScaleInt
impl UnwindSafe for LongScaleInt
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ChineseNumeral for T where
T: ChineseNumeralBase,
impl<T> ChineseNumeral for T where
T: ChineseNumeralBase,
sourcefn to_lowercase(&self, variant: Variant) -> String
fn to_lowercase(&self, variant: Variant) -> String
Converts the number to lowercase (小写数字, used for normal contexts).
sourcefn to_uppercase(&self, variant: Variant) -> String
fn to_uppercase(&self, variant: Variant) -> String
Converts the number to uppercase (大写数字, used for financial contexts).
sourcefn to_lowercase_simp(&self) -> String
fn to_lowercase_simp(&self) -> String
Converts the number to lowercase (小写数字, used for normal contexts) in simplified Chinese.
sourcefn to_lowercase_trad(&self) -> String
fn to_lowercase_trad(&self) -> String
Converts the number to lowercase (小写数字, used for normal contexts) in traditional Chinese.
sourcefn to_uppercase_simp(&self) -> String
fn to_uppercase_simp(&self) -> String
Converts the number to uppercase (大写数字, used for financial contexts) in simplified Chinese.
sourcefn to_uppercase_trad(&self) -> String
fn to_uppercase_trad(&self) -> String
Converts the number to uppercase (大写数字, used for financial contexts) in traditional Chinese.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more