pub struct Unsigned(_, _);Expand description
Human readable unsigned integer.
From takes an unsigned integer as input and returns a ready-to-print!() Unsigned.
f32 or f64 inputs will work, but the fractional parts will be ignored.
Exceptions
| Exceptions | String Output |
|---|---|
f64::NAN | NaN |
f64::INFINITY & f64::NEG_INFINITY | ∞ |
To disable checks for these, (you are sure you don’t have NaN’s), enable the ignore_nan_inf feature flag.
Examples
| Input | Output |
|---|---|
0 | 0 |
1 | 1 |
999 | 999 |
1000 | 1,000 |
1234567 | 1,234,567 |
100000000 | 100,000,000 |
1.123 | 1 |
2000.123 | 2,000 |
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Unsigned
impl<'de> Deserialize<'de> for Unsigned
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Unsigned
impl Ord for Unsigned
source§impl PartialEq<&str> for Unsigned
impl PartialEq<&str> for Unsigned
source§impl PartialEq<Unsigned> for Unsigned
impl PartialEq<Unsigned> for Unsigned
source§impl PartialEq<Unsigned> for str
impl PartialEq<Unsigned> for str
source§impl PartialEq<Unsigned> for u64
impl PartialEq<Unsigned> for u64
source§impl PartialOrd<Unsigned> for Unsigned
impl PartialOrd<Unsigned> for Unsigned
1.0.0 · source§fn 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 moreimpl Eq for Unsigned
impl StructuralEq for Unsigned
impl StructuralPartialEq for Unsigned
Auto Trait Implementations§
impl RefUnwindSafe for Unsigned
impl Send for Unsigned
impl Sync for Unsigned
impl Unpin for Unsigned
impl UnwindSafe for Unsigned
Blanket Implementations§
source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere T: Display,
source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more