pub enum Number {
I64(i64),
U64(u64),
F64(f64),
}Expand description
A number, kept in the widest lossless representation of its source.
Three variants rather than a single f64: JSON integers above i64::MAX
(snowflake IDs, hashes) are real and must round-trip exactly, and f64
silently rounds them.
U64 is reserved for values that do not fit an i64; construct through
Number::from_u64 to keep that canonical. Without it, derived
PartialEq would make I64(1) != U64(1) and equality would depend on
which parser produced the value.
Variants§
Implementations§
Trait Implementations§
impl Copy for Number
impl StructuralPartialEq for Number
Auto Trait Implementations§
impl Freeze for Number
impl RefUnwindSafe for Number
impl Send for Number
impl Sync for Number
impl Unpin for Number
impl UnsafeUnpin for Number
impl UnwindSafe for Number
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