pub enum ParsedNumber {
Dec(BigDecimal),
Inf {
negative: bool,
},
NaN,
EsOrdinal {
n: BigInt,
gender: char,
},
DecPoint {
value: BigDecimal,
pointword: &'static str,
},
}Expand description
What str_to_number produced, including the per-language side effects
Python stashes on self for the same-call handshake.
Variants§
Dec(BigDecimal)
Plain Decimal(value).
Inf
Decimal("Infinity") — representable in Python, but int() on it
raises OverflowError, which the integer path does not catch.
NaN
Decimal("NaN") — int() raises ValueError, which the base integer
path does catch, sending NaN into the float path (where it raises).
EsOrdinal
lang_ES: “1ro” stashes (n, gender); to_cardinal consumes it and
renders to_ordinal(n, gender=...) instead.
DecPoint
lang_PT_BR: US-style “1.50” (dot, no comma) pronounces “ponto” instead of “vírgula” for this call only.
Trait Implementations§
Source§impl Clone for ParsedNumber
impl Clone for ParsedNumber
Source§fn clone(&self) -> ParsedNumber
fn clone(&self) -> ParsedNumber
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParsedNumber
impl RefUnwindSafe for ParsedNumber
impl Send for ParsedNumber
impl Sync for ParsedNumber
impl Unpin for ParsedNumber
impl UnsafeUnpin for ParsedNumber
impl UnwindSafe for ParsedNumber
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more